Skip to content

Commit 1f2cfdd

Browse files
l0kodtorvalds
authored andcommitted
printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin()
The move of proc_dointvec_minmax_sysadmin() from kernel/sysctl.c to kernel/printk/sysctl.c introduced an incorrect __user attribute to the buffer argument. I spotted this change in [1] as well as the kernel test robot. Revert this change to please sparse: kernel/printk/sysctl.c:20:51: warning: incorrect type in argument 3 (different address spaces) kernel/printk/sysctl.c:20:51: expected void * kernel/printk/sysctl.c:20:51: got void [noderef] __user *buffer Fixes: faaa357 ("printk: move printk sysctl to printk/sysctl.c") Link: https://lore.kernel.org/r/[email protected] [1] Reported-by: kernel test robot <[email protected]> Cc: Andrew Morton <[email protected]> Cc: John Ogness <[email protected]> Cc: Luis Chamberlain <[email protected]> Cc: Petr Mladek <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: Steven Rostedt <[email protected]> Cc: Xiaoming Ni <[email protected]> Signed-off-by: Mickaël Salaün <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent 67d6212 commit 1f2cfdd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/printk/sysctl.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
static const int ten_thousand = 10000;
1313

1414
static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
15-
void __user *buffer, size_t *lenp, loff_t *ppos)
15+
void *buffer, size_t *lenp, loff_t *ppos)
1616
{
1717
if (write && !capable(CAP_SYS_ADMIN))
1818
return -EPERM;

0 commit comments

Comments
 (0)