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 sunrpc 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/sunrpc/cache.h | 4 ++++ include/linux/sunrpc/clnt.h | 10 ++++++++++ include/linux/sunrpc/sched.h | 14 ++++++++++++++ include/linux/sunrpc/stats.h | 5 +++++ include/linux/sunrpc/xprt.h | 17 +++++++++++++++++ 5 files changed, 50 insertions(+)
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index d0965e2997b0..0881ac19c0f9 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h @@ -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) };
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 02e7a5863d28..a28300e18fe3 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -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 { diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index df696efdd675..4344151db807 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h @@ -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) };
/* diff --git a/include/linux/sunrpc/stats.h b/include/linux/sunrpc/stats.h index d94d4f410507..52aa43d261e7 100644 --- a/include/linux/sunrpc/stats.h +++ b/include/linux/sunrpc/stats.h @@ -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; diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index e7b997d6f031..39dc06a6f10e 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h @@ -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 {