From: Wang Hai wanghai38@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4HE7P?from=project-issue CVE: NA
--------
Reserve some fields beforehand for some net subsystems framework related structures prone to change.
---------
Signed-off-by: Wang Hai wanghai38@huawei.com Reviewed-by: Yue Haibing yuehaibing@huawei.com Reviewed-by: Wei Yongjun weiyongjun1@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/inetdevice.h | 4 ++++ include/net/devlink.h | 4 ++++ include/net/flow_dissector.h | 6 ++++++ include/net/sch_generic.h | 1 + include/net/tls.h | 10 ++++++++++ include/net/xsk_buff_pool.h | 3 +++ 6 files changed, 28 insertions(+)
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index b68fca08be27..a44812b24687 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -13,6 +13,7 @@ #include <linux/sysctl.h> #include <linux/rtnetlink.h> #include <linux/refcount.h> +#include <linux/kabi.h>
struct ipv4_devconf { void *sysctl; @@ -48,6 +49,9 @@ struct in_device { struct neigh_parms *arp_parms; struct ipv4_devconf cnf; struct rcu_head rcu_head; + + KABI_RESERVE(1) + KABI_RESERVE(2) };
#define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1]) diff --git a/include/net/devlink.h b/include/net/devlink.h index b01bb9bca5a2..dbfcb088c86a 100644 --- a/include/net/devlink.h +++ b/include/net/devlink.h @@ -19,6 +19,7 @@ #include <net/flow_offload.h> #include <uapi/linux/devlink.h> #include <linux/xarray.h> +#include <linux/kabi.h>
#define DEVLINK_RELOAD_STATS_ARRAY_SIZE \ (__DEVLINK_RELOAD_LIMIT_MAX * __DEVLINK_RELOAD_ACTION_MAX) @@ -52,6 +53,9 @@ struct devlink { struct mutex lock; /* Serializes access to devlink instance specific objects such as * port, sb, dpipe, resource, params, region, traps and more. */ + KABI_RESERVE(1) + KABI_RESERVE(2) + u8 reload_failed:1, reload_enabled:1, registered:1; diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h index cc10b10dc3a1..31a748a52c90 100644 --- a/include/net/flow_dissector.h +++ b/include/net/flow_dissector.h @@ -7,6 +7,7 @@ #include <linux/siphash.h> #include <linux/string.h> #include <uapi/linux/if_ether.h> +#include <linux/kabi.h>
struct bpf_prog; struct net; @@ -316,6 +317,11 @@ struct flow_keys { struct flow_dissector_key_icmp icmp; /* 'addrs' must be the last member */ struct flow_dissector_key_addrs addrs; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
#define FLOW_KEYS_HASH_OFFSET \ diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 50dd8be91bf4..3696246d336a 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -116,6 +116,7 @@ struct Qdisc { struct rcu_head rcu;
KABI_RESERVE(1) + KABI_RESERVE(2)
/* private data */ long privdata[] ____cacheline_aligned; diff --git a/include/net/tls.h b/include/net/tls.h index 8e02a6ae247f..fee4e55bd8d9 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -50,6 +50,7 @@ #include <crypto/aead.h> #include <uapi/linux/tls.h>
+#include <linux/kabi.h>
/* Maximum data size carried in a TLS record */ #define TLS_MAX_PAYLOAD_SIZE ((size_t)1 << 14) @@ -167,6 +168,10 @@ struct tls_record_info { u32 end_seq; int len; int num_frags; + + KABI_RESERVE(1) + KABI_RESERVE(2) + skb_frag_t frags[MAX_SKB_FRAGS]; };
@@ -284,6 +289,11 @@ struct tls_context { struct list_head list; refcount_t refcount; struct rcu_head rcu; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
enum tls_offload_ctx_dir { diff --git a/include/net/xsk_buff_pool.h b/include/net/xsk_buff_pool.h index 7a9a23e7a604..33bf0a584f7c 100644 --- a/include/net/xsk_buff_pool.h +++ b/include/net/xsk_buff_pool.h @@ -8,6 +8,7 @@ #include <linux/types.h> #include <linux/dma-mapping.h> #include <net/xdp.h> +#include <linux/kabi.h>
struct xsk_buff_pool; struct xdp_rxq_info; @@ -78,6 +79,8 @@ struct xsk_buff_pool { * sockets share a single cq when the same netdev and queue id is shared. */ spinlock_t cq_lock; + KABI_RESERVE(1) + KABI_RESERVE(2) struct xdp_buff_xsk *free_heads[]; };