printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin()
authorMickaël Salaün <mic@linux.microsoft.com>
Thu, 3 Feb 2022 14:50:29 +0000 (15:50 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 3 Feb 2022 19:27:38 +0000 (11:27 -0800)
commit1f2cfdd349b7647f438c1e552dc1b983da86d830
tree38179f76571135f120d45020af9a1e8b8740a7e3
parent67d6212afda218d564890d1674bab28e8612170f
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: faaa357a55e0 ("printk: move printk sysctl to printk/sysctl.c")
Link: https://lore.kernel.org/r/20220104155024.48023-2-mic@digikod.net
Reported-by: kernel test robot <lkp@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Luis Chamberlain <mcgrof@kernel.org>
Cc: Petr Mladek <pmladek@suse.com>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Xiaoming Ni <nixiaoming@huawei.com>
Signed-off-by: Mickaël Salaün <mic@linux.microsoft.com>
Link: https://lore.kernel.org/r/20220203145029.272640-1-mic@digikod.net
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/printk/sysctl.c