sunrpc: mark all struct rpc_procinfo instances as const

struct rpc_procinfo contains function pointers, and marking it as
constant avoids it being able to be used as an attach vector for
code injections.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
Christoph Hellwig 2017-05-12 15:36:49 +02:00 committed by Anna Schumaker
parent 9ae7d8ff29
commit 511e936bf2
16 changed files with 31 additions and 30 deletions

View file

@ -39,7 +39,7 @@ struct rpc_clnt {
struct list_head cl_tasks; /* List of tasks */
spinlock_t cl_lock; /* spinlock */
struct rpc_xprt __rcu * cl_xprt; /* transport */
struct rpc_procinfo * cl_procinfo; /* procedure info */
const struct rpc_procinfo *cl_procinfo; /* procedure info */
u32 cl_prog, /* RPC program number */
cl_vers, /* RPC version number */
cl_maxproc; /* max procedure number */
@ -87,7 +87,7 @@ struct rpc_program {
struct rpc_version {
u32 number; /* version number */
unsigned int nrprocs; /* number of procs */
struct rpc_procinfo * procs; /* procedure array */
const struct rpc_procinfo *procs; /* procedure array */
unsigned int *counts; /* call counts */
};

View file

@ -22,7 +22,7 @@
*/
struct rpc_procinfo;
struct rpc_message {
struct rpc_procinfo * rpc_proc; /* Procedure information */
const struct rpc_procinfo *rpc_proc; /* Procedure information */
void * rpc_argp; /* Arguments */
void * rpc_resp; /* Result */
struct rpc_cred * rpc_cred; /* Credentials */