linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fixes for work.sysctl
@ 2020-06-03  5:52 Christoph Hellwig
  2020-06-03  5:52 ` [PATCH 1/4] net/sysctl: use cpumask_parse in flow_limit_cpu_sysctl Christoph Hellwig
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-06-03  5:52 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel, linux-kernel

Hi Al,

a bunch of fixes for the sysctl kernel pointer conversion against your
work.sysctl branch.  Only the first one is a real behavior fix, the rest
just removes left over __user annotations.

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

* [PATCH 1/4] net/sysctl: use cpumask_parse in flow_limit_cpu_sysctl
  2020-06-03  5:52 fixes for work.sysctl Christoph Hellwig
@ 2020-06-03  5:52 ` Christoph Hellwig
  2020-06-03  5:52 ` [PATCH 2/4] net/sysctl: remove leftover __user annotations on neigh_proc_dointvec* Christoph Hellwig
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-06-03  5:52 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel,
	linux-kernel, build test robot

cpumask_parse_user works on __user pointers, so this is wrong now.

Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
Reported-by: build test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 net/core/sysctl_net_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 0ddb13a6282b0..d14d049af52ae 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -126,7 +126,7 @@ static int flow_limit_cpu_sysctl(struct ctl_table *table, int write,
 		return -ENOMEM;
 
 	if (write) {
-		ret = cpumask_parse_user(buffer, *lenp, mask);
+		ret = cpumask_parse(buffer, mask);
 		if (ret)
 			goto done;
 
-- 
2.26.2


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

* [PATCH 2/4] net/sysctl: remove leftover __user annotations on neigh_proc_dointvec*
  2020-06-03  5:52 fixes for work.sysctl Christoph Hellwig
  2020-06-03  5:52 ` [PATCH 1/4] net/sysctl: use cpumask_parse in flow_limit_cpu_sysctl Christoph Hellwig
@ 2020-06-03  5:52 ` Christoph Hellwig
  2020-06-03  5:52 ` [PATCH 3/4] random: fix an incorrect __user annotation on proc_do_entropy Christoph Hellwig
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-06-03  5:52 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel,
	linux-kernel, build test robot

Remove the leftover __user annotation on the prototypes for
neigh_proc_dointvec*.  The implementations already got this right, but
the headers kept the __user tags around.

Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
Reported-by: build test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/net/neighbour.h | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index e1476775769c9..81ee17594c329 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -392,13 +392,12 @@ void *neigh_seq_next(struct seq_file *, void *, loff_t *);
 void neigh_seq_stop(struct seq_file *, void *);
 
 int neigh_proc_dointvec(struct ctl_table *ctl, int write,
-			void __user *buffer, size_t *lenp, loff_t *ppos);
+			void *buffer, size_t *lenp, loff_t *ppos);
 int neigh_proc_dointvec_jiffies(struct ctl_table *ctl, int write,
-				void __user *buffer,
+				void *buffer,
 				size_t *lenp, loff_t *ppos);
 int neigh_proc_dointvec_ms_jiffies(struct ctl_table *ctl, int write,
-				   void __user *buffer,
-				   size_t *lenp, loff_t *ppos);
+				   void *buffer, size_t *lenp, loff_t *ppos);
 
 int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
 			  proc_handler *proc_handler);
-- 
2.26.2


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

* [PATCH 3/4] random: fix an incorrect __user annotation on proc_do_entropy
  2020-06-03  5:52 fixes for work.sysctl Christoph Hellwig
  2020-06-03  5:52 ` [PATCH 1/4] net/sysctl: use cpumask_parse in flow_limit_cpu_sysctl Christoph Hellwig
  2020-06-03  5:52 ` [PATCH 2/4] net/sysctl: remove leftover __user annotations on neigh_proc_dointvec* Christoph Hellwig
@ 2020-06-03  5:52 ` Christoph Hellwig
  2020-06-03  5:52 ` [PATCH 4/4] trace: fix an incorrect __user annotation on stack_trace_sysctl Christoph Hellwig
  2020-06-08 13:02 ` fixes for work.sysctl Christoph Hellwig
  4 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-06-03  5:52 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel,
	linux-kernel, build test robot

No user pointers for sysctls anymore.

Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
Reported-by: build test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/char/random.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index 1e0db78b83baa..cf8a43f5eb2a0 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -2087,7 +2087,7 @@ static int proc_do_uuid(struct ctl_table *table, int write,
  * Return entropy available scaled to integral bits
  */
 static int proc_do_entropy(struct ctl_table *table, int write,
-			   void __user *buffer, size_t *lenp, loff_t *ppos)
+			   void *buffer, size_t *lenp, loff_t *ppos)
 {
 	struct ctl_table fake_table;
 	int entropy_count;
-- 
2.26.2


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

* [PATCH 4/4] trace: fix an incorrect __user annotation on stack_trace_sysctl
  2020-06-03  5:52 fixes for work.sysctl Christoph Hellwig
                   ` (2 preceding siblings ...)
  2020-06-03  5:52 ` [PATCH 3/4] random: fix an incorrect __user annotation on proc_do_entropy Christoph Hellwig
@ 2020-06-03  5:52 ` Christoph Hellwig
  2020-06-08 13:02 ` fixes for work.sysctl Christoph Hellwig
  4 siblings, 0 replies; 7+ messages in thread
From: Christoph Hellwig @ 2020-06-03  5:52 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel,
	linux-kernel, build test robot

No user pointers for sysctls anymore.

Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
Reported-by: build test robot <lkp@intel.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/linux/ftrace.h     | 5 ++---
 kernel/trace/trace_stack.c | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index ddfc377de0d2c..fce81238f304d 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -319,9 +319,8 @@ static inline void arch_ftrace_set_direct_caller(struct pt_regs *regs,
 
 extern int stack_tracer_enabled;
 
-int stack_trace_sysctl(struct ctl_table *table, int write,
-		       void __user *buffer, size_t *lenp,
-		       loff_t *ppos);
+int stack_trace_sysctl(struct ctl_table *table, int write, void *buffer,
+		       size_t *lenp, loff_t *ppos);
 
 /* DO NOT MODIFY THIS VARIABLE DIRECTLY! */
 DECLARE_PER_CPU(int, disable_stack_tracer);
diff --git a/kernel/trace/trace_stack.c b/kernel/trace/trace_stack.c
index c557f42a93971..98bba4764c527 100644
--- a/kernel/trace/trace_stack.c
+++ b/kernel/trace/trace_stack.c
@@ -515,9 +515,8 @@ static const struct file_operations stack_trace_filter_fops = {
 #endif /* CONFIG_DYNAMIC_FTRACE */
 
 int
-stack_trace_sysctl(struct ctl_table *table, int write,
-		   void __user *buffer, size_t *lenp,
-		   loff_t *ppos)
+stack_trace_sysctl(struct ctl_table *table, int write, void *buffer,
+		   size_t *lenp, loff_t *ppos)
 {
 	int was_enabled;
 	int ret;
-- 
2.26.2


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

* Re: fixes for work.sysctl
  2020-06-03  5:52 fixes for work.sysctl Christoph Hellwig
                   ` (3 preceding siblings ...)
  2020-06-03  5:52 ` [PATCH 4/4] trace: fix an incorrect __user annotation on stack_trace_sysctl Christoph Hellwig
@ 2020-06-08 13:02 ` Christoph Hellwig
  2020-06-08 14:14   ` Al Viro
  4 siblings, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2020-06-08 13:02 UTC (permalink / raw)
  To: Alexander Viro
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel, linux-kernel

ping?  Can you pick these up now that the original patches are in
Linus' tree?

On Wed, Jun 03, 2020 at 07:52:33AM +0200, Christoph Hellwig wrote:
> Hi Al,
> 
> a bunch of fixes for the sysctl kernel pointer conversion against your
> work.sysctl branch.  Only the first one is a real behavior fix, the rest
> just removes left over __user annotations.
---end quoted text---

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

* Re: fixes for work.sysctl
  2020-06-08 13:02 ` fixes for work.sysctl Christoph Hellwig
@ 2020-06-08 14:14   ` Al Viro
  0 siblings, 0 replies; 7+ messages in thread
From: Al Viro @ 2020-06-08 14:14 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-fsdevel, linux-kernel

On Mon, Jun 08, 2020 at 03:02:46PM +0200, Christoph Hellwig wrote:
> ping?  Can you pick these up now that the original patches are in
> Linus' tree?

Applied and pushed; will send pull request later today.

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

end of thread, other threads:[~2020-06-08 14:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03  5:52 fixes for work.sysctl Christoph Hellwig
2020-06-03  5:52 ` [PATCH 1/4] net/sysctl: use cpumask_parse in flow_limit_cpu_sysctl Christoph Hellwig
2020-06-03  5:52 ` [PATCH 2/4] net/sysctl: remove leftover __user annotations on neigh_proc_dointvec* Christoph Hellwig
2020-06-03  5:52 ` [PATCH 3/4] random: fix an incorrect __user annotation on proc_do_entropy Christoph Hellwig
2020-06-03  5:52 ` [PATCH 4/4] trace: fix an incorrect __user annotation on stack_trace_sysctl Christoph Hellwig
2020-06-08 13:02 ` fixes for work.sysctl Christoph Hellwig
2020-06-08 14:14   ` Al Viro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).