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.
Showing the changes to include/linux (2 of 12 files). Show all
Unified · Split
| @@ -192,9 +192,9 @@ struct nlm_block { · 191 unmodified lines | ||
| 192 | 192 | * Global variables |
| 193 | 193 | */ |
| 194 | 194 | extern const struct rpc_program nlm_program; |
| 195 | −extern struct svc_procedure nlmsvc_procedures[]; | |
| 195 | +extern const struct svc_procedure nlmsvc_procedures[]; | |
| 196 | 196 | #ifdef CONFIG_LOCKD_V4 |
| 197 | −extern struct svc_procedure nlmsvc_procedures4[]; | |
| 197 | +extern const struct svc_procedure nlmsvc_procedures4[]; | |
| 198 | 198 | #endif |
| 199 | 199 | extern int nlmsvc_grace_period; |
| 200 | 200 | extern unsigned long nlmsvc_timeout; |
| @@ -237,7 +237,7 @@ struct svc_rqst { · 236 unmodified lines | ||
| 237 | 237 | |
| 238 | 238 | struct svc_serv * rq_server; /* RPC service definition */ |
| 239 | 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 | 241 | struct auth_ops * rq_authop; /* authentication flavour */ |
| 242 | 242 | struct svc_cred rq_cred; /* auth info */ |
| 243 | 243 | void * rq_xprt_ctxt; /* transport specific context ptr */ |
| @@ -397,7 +397,7 @@ struct svc_program { · 153 unmodified lines | ||
| 397 | 397 | struct svc_version { |
| 398 | 398 | u32 vs_vers; /* version number */ |
| 399 | 399 | u32 vs_nproc; /* number of procedures */ |
| 400 | − struct svc_procedure * vs_proc; /* per-procedure info */ | |
| 400 | + const struct svc_procedure *vs_proc; /* per-procedure info */ | |
| 401 | 401 | unsigned int *vs_count; /* call counts */ |
| 402 | 402 | u32 vs_xdrsize; /* xdrsize needed for this version */ |
| 403 | 403 | |