public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin()
@ 2022-02-03 14:50 Mickaël Salaün
  2022-02-04  3:09 ` Sergey Senozhatsky
  0 siblings, 1 reply; 4+ messages in thread
From: Mickaël Salaün @ 2022-02-03 14:50 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Mickaël Salaün, Andrew Morton, John Ogness,
	Luis Chamberlain, Petr Mladek, Sergey Senozhatsky, Steven Rostedt,
	Xiaoming Ni, linux-kernel, kernel test robot,
	Mickaël Salaün

From: Mickaël Salaün <mic@linux.microsoft.com>

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 [1]
Reported-by: kernel test robot <lkp@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: John Ogness <john.ogness@linutronix.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
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
---
 kernel/printk/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/printk/sysctl.c b/kernel/printk/sysctl.c
index 653ae04aab7f..c228343eeb97 100644
--- a/kernel/printk/sysctl.c
+++ b/kernel/printk/sysctl.c
@@ -12,7 +12,7 @@
 static const int ten_thousand = 10000;
 
 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
-				void __user *buffer, size_t *lenp, loff_t *ppos)
+				void *buffer, size_t *lenp, loff_t *ppos)
 {
 	if (write && !capable(CAP_SYS_ADMIN))
 		return -EPERM;

base-commit: 88808fbbead481aedb46640a5ace69c58287f56a
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin()
  2022-02-03 14:50 [PATCH v1] printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin() Mickaël Salaün
@ 2022-02-04  3:09 ` Sergey Senozhatsky
  2022-02-04 21:51   ` Luis Chamberlain
  2022-02-04 21:52   ` Luis Chamberlain
  0 siblings, 2 replies; 4+ messages in thread
From: Sergey Senozhatsky @ 2022-02-04  3:09 UTC (permalink / raw)
  To: Mickaël Salaün
  Cc: Linus Torvalds, Andrew Morton, John Ogness, Luis Chamberlain,
	Petr Mladek, Sergey Senozhatsky, Steven Rostedt, Xiaoming Ni,
	linux-kernel, kernel test robot, Mickaël Salaün

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@digikod.net [1]
> Reported-by: kernel test robot <lkp@intel.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: John Ogness <john.ogness@linutronix.de>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> 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

Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin()
  2022-02-04  3:09 ` Sergey Senozhatsky
@ 2022-02-04 21:51   ` Luis Chamberlain
  2022-02-04 21:52   ` Luis Chamberlain
  1 sibling, 0 replies; 4+ messages in thread
From: Luis Chamberlain @ 2022-02-04 21:51 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Mickaël Salaün, Linus Torvalds, Andrew Morton,
	John Ogness, Petr Mladek, Steven Rostedt, Xiaoming Ni,
	linux-kernel, kernel test robot, Mickaël Salaün

On Fri, Feb 04, 2022 at 12:09:55PM +0900, Sergey Senozhatsky wrote:
> 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@digikod.net [1]
> > Reported-by: kernel test robot <lkp@intel.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: John Ogness <john.ogness@linutronix.de>
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> > 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
> 
> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v1] printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin()
  2022-02-04  3:09 ` Sergey Senozhatsky
  2022-02-04 21:51   ` Luis Chamberlain
@ 2022-02-04 21:52   ` Luis Chamberlain
  1 sibling, 0 replies; 4+ messages in thread
From: Luis Chamberlain @ 2022-02-04 21:52 UTC (permalink / raw)
  To: Sergey Senozhatsky
  Cc: Mickaël Salaün, Linus Torvalds, Andrew Morton,
	John Ogness, Petr Mladek, Steven Rostedt, Xiaoming Ni,
	linux-kernel, kernel test robot, Mickaël Salaün

On Fri, Feb 04, 2022 at 12:09:55PM +0900, Sergey Senozhatsky wrote:
> 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@digikod.net [1]
> > Reported-by: kernel test robot <lkp@intel.com>
> > Cc: Andrew Morton <akpm@linux-foundation.org>
> > Cc: John Ogness <john.ogness@linutronix.de>
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> > 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
> 
> Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>

Acked-by: Luis Chamberlain <mcgrof@kernel.org>

  Luis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-04 21:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-03 14:50 [PATCH v1] printk: Fix incorrect __user type in proc_dointvec_minmax_sysadmin() Mickaël Salaün
2022-02-04  3:09 ` Sergey Senozhatsky
2022-02-04 21:51   ` Luis Chamberlain
2022-02-04 21:52   ` Luis Chamberlain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox