]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
treewide: Fix function prototypes for module_param_call()
authorKees Cook <keescook@chromium.org>
Wed, 18 Oct 2017 02:04:42 +0000 (19:04 -0700)
committerJessica Yu <jeyu@kernel.org>
Tue, 31 Oct 2017 14:30:37 +0000 (15:30 +0100)
commite4dca7b7aa08b22893c45485d222b5807c1375ae
treeb78ba1697b14cf171f053732a8d6b544cfb45891
parentb2f270e8747387335d80428c576118e7d87f69cc
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>
42 files changed:
arch/powerpc/platforms/pseries/cmm.c
arch/x86/oprofile/nmi_int.c
drivers/acpi/button.c
drivers/acpi/ec.c
drivers/acpi/sysfs.c
drivers/android/binder.c
drivers/char/ipmi/ipmi_poweroff.c
drivers/char/ipmi/ipmi_si_intf.c
drivers/edac/edac_mc_sysfs.c
drivers/edac/edac_module.c
drivers/hid/hid-magicmouse.c
drivers/ide/ide.c
drivers/infiniband/hw/qib/qib_iba7322.c
drivers/infiniband/ulp/srpt/ib_srpt.c
drivers/isdn/hardware/mISDN/avmfritz.c
drivers/isdn/hardware/mISDN/mISDNinfineon.c
drivers/isdn/hardware/mISDN/netjet.c
drivers/isdn/hardware/mISDN/speedfax.c
drivers/isdn/hardware/mISDN/w6692.c
drivers/md/md.c
drivers/media/pci/tw686x/tw686x-core.c
drivers/media/usb/uvc/uvc_driver.c
drivers/message/fusion/mptbase.c
drivers/misc/kgdbts.c
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/phram.c
drivers/mtd/ubi/build.c
drivers/pci/pcie/aspm.c
drivers/platform/x86/thinkpad_acpi.c
drivers/scsi/fcoe/fcoe_transport.c
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/mpt3sas/mpt3sas_scsih.c
drivers/tty/serial/kgdboc.c
fs/fuse/inode.c
fs/lockd/svc.c
fs/ocfs2/dlmfs/dlmfs.c
include/net/netfilter/nf_conntrack.h
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_nat_ftp.c
net/netfilter/nf_nat_irc.c
net/sunrpc/svc.c
security/apparmor/lsm.c