1
0
Fork 0
alistair23-linux/drivers/tty
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
..
hvc powerpc updates for 4.14 2017-09-07 10:15:40 -07:00
ipwireless networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
serdev tty: Convert to using %pOF instead of full_name 2017-07-30 07:35:28 -07:00
serial treewide: Fix function prototypes for module_param_call() 2017-10-31 15:30:37 +01:00
vt vt: fix \e[2m using the wrong placeholder color on graphical consoles 2017-06-09 11:20:08 +02:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next 2017-09-10 09:57:23 -07:00
Makefile sparc64: vcc: Enable VCC module in linux 2017-08-15 21:33:50 -07:00
amiserial.c tty: amiserial: drop broken alt-speed support 2017-06-13 11:49:58 +02:00
bfin_jtag_comm.c
cyclades.c tty: cyclades: drop broken alt-speed support 2017-06-13 11:49:58 +02:00
ehv_bytechan.c tty: Convert to using %pOF instead of full_name 2017-07-30 07:35:28 -07:00
goldfish.c tty: goldfish: Implement support for kernel 'earlycon' parameter 2017-08-31 18:58:45 +02:00
isicom.c tty: isicom: constify pci_device_id. 2017-07-30 07:35:27 -07:00
metag_da.c timers, drivers/tty/metag_da: Initialize the poll timer as pinned 2016-07-07 10:25:14 +02:00
mips_ejtag_fdc.c tty: mips_ejtag_fdc: constify mips_cdmm_device_id 2017-08-28 20:51:22 +02:00
moxa.c tty: moxa: constify pci_device_id. 2017-07-30 07:35:28 -07:00
moxa.h
mxser.c mxser: fix timeout calculation for low rates 2017-09-18 18:19:20 +02:00
mxser.h
n_gsm.c tty: n_gsm: Add compat_ioctl 2017-08-28 20:51:22 +02:00
n_hdlc.c format-security: move static strings to const 2017-05-08 17:15:14 -07:00
n_null.c tty: handle the case where we cannot restore a line discipline 2017-06-03 18:43:46 +09:00
n_r3964.c Replace <asm/uaccess.h> with <linux/uaccess.h> globally 2016-12-24 11:46:01 -08:00
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c Fix OpenSSH pty regression on close 2016-05-01 13:22:54 -07:00
nozomi.c tty: nozomi: avoid sprintf buffer overflow 2016-11-29 20:20:07 +01:00
pty.c TTY/Serial updates for 4.14-rc1 2017-09-05 10:30:48 -07:00
rocket.c tty: rocket: drop broken alt-speed support 2017-06-13 11:49:58 +02:00
rocket.h
rocket_int.h tty: rocket: Remove private close_wait 2016-01-28 14:13:44 -08:00
synclink.c tty: synclink: constify pci_device_id. 2017-07-30 07:35:27 -07:00
synclink_gt.c tty: synclink_gt: constify pci_device_id. 2017-07-30 07:35:28 -07:00
synclinkmp.c tty: synclinkmp: constify pci_device_id. 2017-07-30 07:35:27 -07:00
sysrq.c oom: improve oom disable handling 2017-05-03 15:52:10 -07:00
tty_audit.c tty: audit: remove unused variable 2016-03-07 16:11:14 -08:00
tty_baudrate.c tty: move baudrate handling code to a file of its own 2017-04-18 18:01:52 +02:00
tty_buffer.c tty: fix __tty_insert_flip_char regression 2017-08-02 06:58:17 -07:00
tty_io.c Staging/IIO driver updates for 4.14-rc1 2017-09-05 10:36:26 -07:00
tty_ioctl.c tty: move baudrate handling code to a file of its own 2017-04-18 18:01:52 +02:00
tty_jobctrl.c tty: split job control support into a file of its own 2017-04-18 18:01:52 +02:00
tty_ldisc.c tty: fall back to N_NULL if switching to N_TTY fails during hangup 2017-10-13 16:18:33 -07:00
tty_ldsem.c sched/headers: Prepare to move the get_task_struct()/put_task_struct() and related APIs from <linux/sched.h> to <linux/sched/task.h> 2017-03-02 08:42:40 +01:00
tty_mutex.c Merge 4.5-rc4 into tty-next 2016-02-14 14:36:04 -08:00
tty_port.c Revert "tty: fix port buffer locking" 2017-06-04 10:23:25 +02:00
vcc.c sparc64: vcc: make ktermios const 2017-08-29 15:10:44 -07:00