linux/fs/lockd
Kees Cook e4dca7b7aa treewide: Fix function prototypes for module_param_call()
Several function prototypes for the set/get functions defined by
module_param_call() have a slightly wrong argument types. This fixes
those in an effort to clean up the calls when running under type-enforced
compiler instrumentation for CFI. This is the result of running the
following semantic patch:

@match_module_param_call_function@
declarer name module_param_call;
identifier _name, _set_func, _get_func;
expression _arg, _mode;
@@

 module_param_call(_name, _set_func, _get_func, _arg, _mode);

@fix_set_prototype
 depends on match_module_param_call_function@
identifier match_module_param_call_function._set_func;
identifier _val, _param;
type _val_type, _param_type;
@@

 int _set_func(
-_val_type _val
+const char * _val
 ,
-_param_type _param
+const struct kernel_param * _param
 ) { ... }

@fix_get_prototype
 depends on match_module_param_call_function@
identifier match_module_param_call_function._get_func;
identifier _val, _param;
type _val_type, _param_type;
@@

 int _get_func(
-_val_type _val
+char * _val
 ,
-_param_type _param
+const struct kernel_param * _param
 ) { ... }

Two additional by-hand changes are included for places where the above
Coccinelle script didn't notice them:

	drivers/platform/x86/thinkpad_acpi.c
	fs/lockd/svc.c

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
2017-10-31 15:30:37 +01:00
..
clnt4xdr.c sunrpc: mark all struct rpc_procinfo instances as const 2017-05-15 17:42:20 +02:00
clntlock.c lockd: Delete an error message for a failed memory allocation in reclaimer() 2017-09-06 12:33:56 -04:00
clntproc.c lockd: Introduce nlmclnt_operations 2017-04-21 10:45:01 -04:00
clntxdr.c sunrpc: mark all struct rpc_procinfo instances as const 2017-05-15 17:42:20 +02:00
host.c lockd: get rid of reference-counted NSM RPC clients 2015-10-23 15:57:27 -04:00
Makefile lockd: add a /proc/fs/lockd/nlm_end_grace file 2014-09-17 16:33:13 -04:00
mon.c sunrpc: mark all struct rpc_procinfo instances as const 2017-05-15 17:42:20 +02:00
netns.h netns: make struct pernet_operations::id unsigned int 2016-11-18 10:59:15 -05:00
procfs.c drop redundant ->owner initializations 2016-05-29 19:08:00 -04:00
procfs.h treewide: remove redundant #include <linux/kconfig.h> 2016-10-11 15:06:33 -07:00
svc4proc.c sunrpc: mark all struct svc_procinfo instances as const 2017-05-15 17:42:31 +02:00
svc.c treewide: Fix function prototypes for module_param_call() 2017-10-31 15:30:37 +01:00
svclock.c lockd: remove redundant check on block 2017-04-25 17:25:56 -04:00
svcproc.c sunrpc: mark all struct svc_procinfo instances as const 2017-05-15 17:42:31 +02:00
svcshare.c lockd: fix sparse warning in svcshare.c 2008-04-23 16:13:39 -04:00
svcsubs.c nfsd: eliminate NFSD_DEBUG 2015-04-21 16:16:02 -04:00
xdr4.c sunrpc: properly type pc_encode callbacks 2017-05-15 17:42:25 +02:00
xdr.c sunrpc: properly type pc_encode callbacks 2017-05-15 17:42:25 +02:00