hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I8ZMS7
----------------------------------------------------
Reserve some fields beforehand for net related structures prone to change.
Signed-off-by: Zhengchao Shao shaozhengchao@huawei.com --- include/linux/netlink.h | 5 +++++ include/net/cfg802154.h | 5 +++++ include/net/netns/conntrack.h | 4 ++++ include/net/netns/core.h | 6 ++++++ include/net/xfrm.h | 8 ++++++++ 5 files changed, 28 insertions(+)
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 75d7de34c908..4111d53f4656 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h @@ -8,6 +8,7 @@ #include <linux/export.h> #include <net/scm.h> #include <uapi/linux/netlink.h> +#include <linux/kabi.h>
struct net;
@@ -88,6 +89,10 @@ struct netlink_ext_ack { u8 cookie[NETLINK_MAX_COOKIE_LEN]; u8 cookie_len; char _msg_buf[NETLINK_MAX_FMTMSG_LEN]; + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
/* Always use this macro, this allows later putting the diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h index f79ce133e51a..61aabd82b789 100644 --- a/include/net/cfg802154.h +++ b/include/net/cfg802154.h @@ -16,6 +16,8 @@
#include <net/nl802154.h>
+#include <linux/kabi.h> + struct wpan_phy; struct wpan_phy_cca; struct cfg802154_scan_request; @@ -242,6 +244,9 @@ struct wpan_phy { */ enum ieee802154_filtering_level filtering;
+ KABI_RESERVE(1) + KABI_RESERVE(2) + char priv[] __aligned(NETDEV_ALIGN); };
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h index 1f463b3957c7..308c54643b3a 100644 --- a/include/net/netns/conntrack.h +++ b/include/net/netns/conntrack.h @@ -14,6 +14,7 @@ #include <linux/netfilter/nf_conntrack_sctp.h> #endif #include <linux/seqlock.h> +#include <linux/kabi.h>
struct ctl_table_header; struct nf_conntrack_ecache; @@ -31,6 +32,9 @@ struct nf_tcp_net { #if IS_ENABLED(CONFIG_NF_FLOW_TABLE) unsigned int offload_timeout; #endif + + KABI_RESERVE(1) + KABI_RESERVE(2) };
enum udp_conntrack { diff --git a/include/net/netns/core.h b/include/net/netns/core.h index a91ef9f8de60..dfb54998c497 100644 --- a/include/net/netns/core.h +++ b/include/net/netns/core.h @@ -3,6 +3,7 @@ #define __NETNS_CORE_H__
#include <linux/types.h> +#include <linux/kabi.h>
struct ctl_table_header; struct prot_inuse; @@ -22,6 +23,11 @@ struct netns_core { #if IS_ENABLED(CONFIG_RPS) && IS_ENABLED(CONFIG_SYSCTL) struct cpumask *rps_default_mask; #endif + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
#endif diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 363c7d510554..9eff85ef369c 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -32,6 +32,8 @@ #include <net/snmp.h> #endif
+#include <linux/kabi.h> + #define XFRM_PROTO_ESP 50 #define XFRM_PROTO_AH 51 #define XFRM_PROTO_COMP 108 @@ -289,6 +291,9 @@ struct xfrm_state { /* Private data of this transformer, format is opaque, * interpreted by xfrm_type methods. */ void *data; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
static inline struct net *xs_net(struct xfrm_state *x) @@ -549,6 +554,9 @@ struct xfrm_policy { struct rcu_head rcu;
struct xfrm_dev_offload xdo; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
static inline struct net *xp_net(const struct xfrm_policy *xp)