Commit 6ba70efc authored by Wang Hai's avatar Wang Hai Committed by Zheng Zengkai
Browse files

kabi: net: reserve space for net sunrpc 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 sunrpc 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 1aa7ceab
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/slab.h>
#include <linux/atomic.h>
#include <linux/proc_fs.h>
#include <linux/kabi.h>

/*
 * Each cache requires:
@@ -118,6 +119,9 @@ struct cache_detail {
		struct dentry		*pipefs;
	};
	struct net		*net;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};


+10 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <linux/path.h>
#include <net/ipv6.h>
#include <linux/sunrpc/xprtmultipath.h>
#include <linux/kabi.h>

struct rpc_inode;

@@ -79,6 +80,11 @@ struct rpc_clnt {
		struct work_struct	cl_work;
	};
	const struct cred	*cl_cred;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

/*
@@ -92,6 +98,8 @@ struct rpc_program {
	const struct rpc_version **	version;	/* version array */
	struct rpc_stat *	stats;		/* statistics */
	const char *		pipe_dir_name;	/* path to rpc_pipefs dir */

	KABI_RESERVE(1)
};

struct rpc_version {
@@ -133,6 +141,8 @@ struct rpc_create_args {
	char			*client_name;
	struct svc_xprt		*bc_xprt;	/* NFSv4.1 backchannel */
	const struct cred	*cred;

	KABI_RESERVE(1)
};

struct rpc_add_xprt_test {
+14 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
#include <linux/wait_bit.h>
#include <linux/workqueue.h>
#include <linux/sunrpc/xdr.h>
#include <linux/kabi.h>

/*
 * This is the actual RPC procedure call info.
@@ -27,6 +28,8 @@ struct rpc_message {
	void *			rpc_argp;	/* Arguments */
	void *			rpc_resp;	/* Result */
	const struct cred *	rpc_cred;	/* Credentials */

	KABI_RESERVE(1)
};

struct rpc_call_ops;
@@ -92,6 +95,11 @@ struct rpc_task {
				tk_garb_retry : 2,
				tk_cred_retry : 2,
				tk_rebind_retry : 2;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

typedef void			(*rpc_action)(struct rpc_task *);
@@ -101,6 +109,9 @@ struct rpc_call_ops {
	void (*rpc_call_done)(struct rpc_task *, void *);
	void (*rpc_count_stats)(struct rpc_task *, void *);
	void (*rpc_release)(void *);

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

struct rpc_task_setup {
@@ -114,6 +125,9 @@ struct rpc_task_setup {
	struct workqueue_struct *workqueue;
	unsigned short flags;
	signed char priority;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

/*
+5 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#define _LINUX_SUNRPC_STATS_H

#include <linux/proc_fs.h>
#include <linux/kabi.h>

struct rpc_stat {
	const struct rpc_program *program;
@@ -24,6 +25,8 @@ struct rpc_stat {
				rpcretrans,
				rpcauthrefresh,
				rpcgarbage;

	KABI_RESERVE(1)
};

struct svc_stat {
@@ -37,6 +40,8 @@ struct svc_stat {
				rpcbadfmt,
				rpcbadauth,
				rpcbadclnt;

	KABI_RESERVE(1)
};

struct net;
+17 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#include <linux/sunrpc/sched.h>
#include <linux/sunrpc/xdr.h>
#include <linux/sunrpc/msg_prot.h>
#include <linux/kabi.h>

#define RPC_MIN_SLOT_TABLE	(2U)
#define RPC_DEF_SLOT_TABLE	(16U)
@@ -39,6 +40,9 @@ struct rpc_timeout {
				to_increment;		/* if !exponential */
	unsigned int		to_retries;		/* max # of retries */
	unsigned char		to_exponential;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

enum rpc_display_format_t {
@@ -124,6 +128,11 @@ struct rpc_rqst {
	unsigned long		rq_bc_pa_state;	/* Backchannel prealloc state */
	struct list_head	rq_bc_pa_list;	/* Backchannel prealloc list */
#endif /* CONFIG_SUNRPC_BACKCHANEL */

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};
#define rq_svec			rq_snd_buf.head
#define rq_slen			rq_snd_buf.len
@@ -287,6 +296,11 @@ struct rpc_xprt {
	atomic_t		inject_disconnect;
#endif
	struct rcu_head		rcu;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
	KABI_RESERVE(3)
	KABI_RESERVE(4)
};

#if defined(CONFIG_SUNRPC_BACKCHANNEL)
@@ -322,6 +336,9 @@ struct xprt_create {
	struct svc_xprt		*bc_xprt;	/* NFSv4.1 backchannel */
	struct rpc_xprt_switch	*bc_xps;
	unsigned int		flags;

	KABI_RESERVE(1)
	KABI_RESERVE(2)
};

struct xprt_class {