Re: [PATCH v1] printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin()

From: Sergey Senozhatsky
Date: Thu Feb 03 2022 - 22:10:03 EST


On (22/02/03 15:50), Mickaël Salaün wrote:
> 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@xxxxxxxxxxx [1]
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: John Ogness <john.ogness@xxxxxxxxxxxxx>
> Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
> Cc: Luis Chamberlain <mcgrof@xxxxxxxxxx>
> Cc: Petr Mladek <pmladek@xxxxxxxx>
> Cc: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Xiaoming Ni <nixiaoming@xxxxxxxxxx>
> Signed-off-by: Mickaël Salaün <mic@xxxxxxxxxxxxxxxxxxx>
> Link: https://lore.kernel.org/r/20220203145029.272640-1-mic@xxxxxxxxxxx

Reviewed-by: Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>