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 net bpf framework related structures prone to change.
---------
Signed-off-by: Wang Hai wanghai38@huawei.com Reviewed-by: Wei Yongjun weiyongjun1@huawei.com Reviewed-by: Yue Haibing yuehaibing@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- include/linux/skmsg.h | 11 +++++++++++ include/net/tcp.h | 6 ++++++ include/net/xdp.h | 6 ++++++ 3 files changed, 23 insertions(+)
diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h index 822c048934e3..23d4e86a4395 100644 --- a/include/linux/skmsg.h +++ b/include/linux/skmsg.h @@ -12,6 +12,7 @@ #include <net/sock.h> #include <net/tcp.h> #include <net/strparser.h> +#include <linux/kabi.h>
#define MAX_MSG_FRAGS MAX_SKB_FRAGS #define NR_MSG_FRAG_IDS (MAX_MSG_FRAGS + 1) @@ -58,6 +59,11 @@ struct sk_psock_progs { struct bpf_prog *msg_parser; struct bpf_prog *skb_parser; struct bpf_prog *skb_verdict; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
enum sk_psock_state_bits { @@ -107,6 +113,11 @@ struct sk_psock { struct rcu_head rcu; struct work_struct gc; }; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
int sk_msg_alloc(struct sock *sk, struct sk_msg *msg, int len, diff --git a/include/net/tcp.h b/include/net/tcp.h index 334b8d1b5442..bbd8fb63f4c1 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -45,6 +45,7 @@ #include <linux/memcontrol.h> #include <linux/bpf-cgroup.h> #include <linux/siphash.h> +#include <linux/kabi.h>
extern struct inet_hashinfo tcp_hashinfo;
@@ -1084,6 +1085,11 @@ struct tcp_congestion_ops {
char name[TCP_CA_NAME_MAX]; struct module *owner; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) };
int tcp_register_congestion_control(struct tcp_congestion_ops *type); diff --git a/include/net/xdp.h b/include/net/xdp.h index 9dab2bc6f187..c7a2fadb9ba8 100644 --- a/include/net/xdp.h +++ b/include/net/xdp.h @@ -7,6 +7,7 @@ #define __LINUX_NET_XDP_H__
#include <linux/skbuff.h> /* skb_shared_info */ +#include <linux/kabi.h>
/** * DOC: XDP RX-queue information @@ -59,6 +60,11 @@ struct xdp_rxq_info { u32 queue_index; u32 reg_state; struct xdp_mem_info mem; + + KABI_RESERVE(1) + KABI_RESERVE(2) + KABI_RESERVE(3) + KABI_RESERVE(4) } ____cacheline_aligned; /* perf critical, avoid false-sharing */
struct xdp_txq_info {