diff options
| author | Christoph Hellwig <hch@lst.de> | 2017-05-12 10:11:49 -0400 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2017-05-15 11:42:31 -0400 |
| commit | 860bda29b99afdc072a7a796fe81185f7ae85deb (patch) | |
| tree | 801d2c90df6046bfec0b3be678d84acc2b5637e8 /include/linux | |
| parent | 7fd38af9cae6aef1dfd28a7d1bd214eb5ddb7d53 (diff) | |
sunrpc: mark all struct svc_procinfo instances as const
struct svc_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>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/lockd/lockd.h | 4 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 41f7b6a04d69..3eca67728366 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
| @@ -192,9 +192,9 @@ struct nlm_block { | |||
| 192 | * Global variables | 192 | * Global variables |
| 193 | */ | 193 | */ |
| 194 | extern const struct rpc_program nlm_program; | 194 | extern const struct rpc_program nlm_program; |
| 195 | extern struct svc_procedure nlmsvc_procedures[]; | 195 | extern const struct svc_procedure nlmsvc_procedures[]; |
| 196 | #ifdef CONFIG_LOCKD_V4 | 196 | #ifdef CONFIG_LOCKD_V4 |
| 197 | extern struct svc_procedure nlmsvc_procedures4[]; | 197 | extern const struct svc_procedure nlmsvc_procedures4[]; |
| 198 | #endif | 198 | #endif |
| 199 | extern int nlmsvc_grace_period; | 199 | extern int nlmsvc_grace_period; |
| 200 | extern unsigned long nlmsvc_timeout; | 200 | extern unsigned long nlmsvc_timeout; |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 9f00384153f4..984e6b9c3043 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -237,7 +237,7 @@ struct svc_rqst { | |||
| 237 | 237 | ||
| 238 | struct svc_serv * rq_server; /* RPC service definition */ | 238 | struct svc_serv * rq_server; /* RPC service definition */ |
| 239 | struct svc_pool * rq_pool; /* thread pool */ | 239 | struct svc_pool * rq_pool; /* thread pool */ |
| 240 | struct svc_procedure * rq_procinfo; /* procedure info */ | 240 | const struct svc_procedure *rq_procinfo;/* procedure info */ |
| 241 | struct auth_ops * rq_authop; /* authentication flavour */ | 241 | struct auth_ops * rq_authop; /* authentication flavour */ |
| 242 | struct svc_cred rq_cred; /* auth info */ | 242 | struct svc_cred rq_cred; /* auth info */ |
| 243 | void * rq_xprt_ctxt; /* transport specific context ptr */ | 243 | void * rq_xprt_ctxt; /* transport specific context ptr */ |
| @@ -396,7 +396,7 @@ struct svc_program { | |||
| 396 | struct svc_version { | 396 | struct svc_version { |
| 397 | u32 vs_vers; /* version number */ | 397 | u32 vs_vers; /* version number */ |
| 398 | u32 vs_nproc; /* number of procedures */ | 398 | u32 vs_nproc; /* number of procedures */ |
| 399 | struct svc_procedure * vs_proc; /* per-procedure info */ | 399 | const struct svc_procedure *vs_proc; /* per-procedure info */ |
| 400 | unsigned int *vs_count; /* call counts */ | 400 | unsigned int *vs_count; /* call counts */ |
| 401 | u32 vs_xdrsize; /* xdrsize needed for this version */ | 401 | u32 vs_xdrsize; /* xdrsize needed for this version */ |
| 402 | 402 | ||
