Commit 8b48fcfc authored by Wang Hai's avatar Wang Hai Committed by Zheng Zengkai
Browse files

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

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: default avatarWang Hai <wanghai38@huawei.com>
Reviewed-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: default avatarYue Haibing <yuehaibing@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 7d9f92e3
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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,
+6 −0
Original line number Diff line number Diff line
@@ -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);
+6 −0
Original line number Diff line number Diff line
@@ -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 {