seccomp: Remove bogus __user annotations
authorJann Horn <jannh@google.com>
Fri, 20 Nov 2020 17:05:45 +0000 (18:05 +0100)
committerKees Cook <keescook@chromium.org>
Fri, 20 Nov 2020 19:39:21 +0000 (11:39 -0800)
Buffers that are passed to read_actions_logged() and write_actions_logged()
are in kernel memory; the sysctl core takes care of copying from/to
userspace.

Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
Reviewed-by: Tyler Hicks <code@tyhicks.com>
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20201120170545.1419332-1-jannh@google.com
kernel/seccomp.c

index 76f524e320b1849f9730ed0e32f30ebc9c771dc9..0e0e369d2fcb88adc031d101c9373cf5fc35cfc3 100644 (file)
@@ -2202,7 +2202,7 @@ static bool seccomp_actions_logged_from_names(u32 *actions_logged, char *names)
        return true;
 }
 
-static int read_actions_logged(struct ctl_table *ro_table, void __user *buffer,
+static int read_actions_logged(struct ctl_table *ro_table, void *buffer,
                               size_t *lenp, loff_t *ppos)
 {
        char names[sizeof(seccomp_actions_avail)];
@@ -2220,7 +2220,7 @@ static int read_actions_logged(struct ctl_table *ro_table, void __user *buffer,
        return proc_dostring(&table, 0, buffer, lenp, ppos);
 }
 
-static int write_actions_logged(struct ctl_table *ro_table, void __user *buffer,
+static int write_actions_logged(struct ctl_table *ro_table, void *buffer,
                                size_t *lenp, loff_t *ppos, u32 *actions_logged)
 {
        char names[sizeof(seccomp_actions_avail)];