Commit bb2f65e5 authored by Wang Hai's avatar Wang Hai Committed by Zhengchao Shao
Browse files

kabi: net: reserve space for net netfilter subsystem related structure

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8OWRC



----------------------------------------------------

Reserve some fields beforehand for net netfilter framework related
structures prone to change.

Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
Signed-off-by: default avatarZhengchao Shao <shaozhengchao@huawei.com>
parent 550374c2
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/netdevice.h>
#include <linux/sockptr.h>
#include <net/net_namespace.h>
#include <linux/kabi.h>

static inline int NF_DROP_GETERR(int verdict)
{
@@ -179,6 +180,9 @@ struct nf_sockopt_ops {
	int (*get)(struct sock *sk, int optval, void __user *user, int *len);
	/* Use the module struct to lock set/get code in place */
	struct module *owner;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

/* Function to register/unregister hook points. */
@@ -377,6 +381,9 @@ struct nf_nat_hook {
				  enum nf_nat_manip_type mtype,
				  enum ip_conntrack_dir dir);
	void (*remove_nat_bysrc)(struct nf_conn *ct);

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

extern const struct nf_nat_hook __rcu *nf_nat_hook;
@@ -464,6 +471,9 @@ struct nf_ct_hook {
			      const struct sk_buff *);
	void (*attach)(struct sk_buff *nskb, const struct sk_buff *skb);
	void (*set_closing)(struct nf_conntrack *nfct);

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};
extern const struct nf_ct_hook __rcu *nf_ct_hook;

@@ -479,6 +489,9 @@ struct nfnl_ct_hook {
			     u32 portid, u32 report);
	void (*seq_adjust)(struct sk_buff *skb, struct nf_conn *ct,
			   enum ip_conntrack_info ctinfo, s32 off);

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};
extern const struct nfnl_ct_hook __rcu *nfnl_ct_hook;

+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <linux/vmalloc.h>
#include <net/netlink.h>
#include <uapi/linux/netfilter/ipset/ip_set.h>
#include <linux/kabi.h>

#define _IP_SET_MODULE_DESC(a, b, c)		\
	MODULE_DESCRIPTION(a " type of IP sets, revisions " b "-" c)
@@ -188,6 +189,9 @@ struct ip_set_type_variant {
	bool (*same_set)(const struct ip_set *a, const struct ip_set *b);
	/* Region-locking is used */
	bool region_lock;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

struct ip_set_region {
@@ -234,6 +238,9 @@ struct ip_set_type {

	/* Set this to THIS_MODULE if you are a module, otherwise NULL */
	struct module *me;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

/* register and unregister set type */
@@ -276,6 +283,9 @@ struct ip_set {
	size_t offset[IPSET_EXT_ID_MAX];
	/* The type specific data */
	void *data;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

static inline void
+7 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#include <linux/capability.h>
#include <net/netlink.h>
#include <uapi/linux/netfilter/nfnetlink.h>
#include <linux/kabi.h>

struct nfnl_info {
	struct net		*net;
@@ -28,6 +29,9 @@ struct nfnl_callback {
	const struct nla_policy	*policy;
	enum nfnl_callback_type	type;
	__u16			attr_count;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

enum nfnl_abort_action {
@@ -46,6 +50,9 @@ struct nfnetlink_subsystem {
	int (*abort)(struct net *net, struct sk_buff *skb,
		     enum nfnl_abort_action action);
	bool (*valid_genid)(struct net *net, u32 genid);

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
+4 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@

#include <uapi/linux/netfilter_ipv6.h>
#include <net/tcp.h>
#include <linux/kabi.h>

/* Check for an extension */
static inline int
@@ -65,6 +66,9 @@ struct nf_ipv6_ops {
					 const struct nf_bridge_frag_data *data,
					 struct sk_buff *));
#endif

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

#ifdef CONFIG_NETFILTER
+4 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
#include <linux/netfilter/nf_conntrack_proto_gre.h>

#include <net/netfilter/nf_conntrack_tuple.h>
#include <linux/kabi.h>

struct nf_ct_udp {
	unsigned long	stream_ts;
@@ -123,6 +124,9 @@ struct nf_conn {

	/* Storage reserved for other modules, must be the last member */
	union nf_conntrack_proto proto;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

static inline struct nf_conn *
Loading