[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200424190650.GA72647@rdna-mbp.dhcp.thefacebook.com>
Date: Fri, 24 Apr 2020 12:06:50 -0700
From: Andrey Ignatov <rdna@...com>
To: Christoph Hellwig <hch@....de>
CC: Kees Cook <keescook@...omium.org>,
Iurii Zaikin <yzaikin@...gle.com>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
<linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
<linux-fsdevel@...r.kernel.org>, <netdev@...r.kernel.org>,
<bpf@...r.kernel.org>
Subject: Re: [PATCH 5/5] sysctl: pass kernel pointers to ->proc_handler
Christoph Hellwig <hch@....de> [Thu, 2020-04-23 23:44 -0700]:
> Instead of having all the sysctl handlers deal with user pointers, which
> is rather hairy in terms of the BPF interaction, copy the input to and
> from userspace in common code. This also means that the strings are
> always NUL-terminated by the common code, making the API a little bit
> safer.
>
> As most handler just pass through the data to one of the common handlers
> a lot of the changes are mechnical.
>
> Signed-off-by: Christoph Hellwig <hch@....de>
> Acked-by: Andrey Ignatov <rdna@...com>
...
> @@ -72,33 +70,21 @@ extern unsigned int sysctl_sched_autogroup_enabled;
> extern int sysctl_sched_rr_timeslice;
> extern int sched_rr_timeslice;
>
> -extern int sched_rr_handler(struct ctl_table *table, int write,
> - void __user *buffer, size_t *lenp,
> - loff_t *ppos);
> -
> -extern int sched_rt_handler(struct ctl_table *table, int write,
> - void __user *buffer, size_t *lenp,
> - loff_t *ppos);
> -
> -#ifdef CONFIG_UCLAMP_TASK
Decided to skim through the patch one last time to double-check the fix
from previous iteration and found that this ifdef got lost below.
> -extern int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
> - void __user *buffer, size_t *lenp,
> - loff_t *ppos);
> -#endif
> -
> -extern int sysctl_numa_balancing(struct ctl_table *table, int write,
> - void __user *buffer, size_t *lenp,
> - loff_t *ppos);
> -
> -extern int sysctl_schedstats(struct ctl_table *table, int write,
> - void __user *buffer, size_t *lenp,
> - loff_t *ppos);
> +int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
> + size_t *lenp, loff_t *ppos);
> +int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
> + size_t *lenp, loff_t *ppos);
> +int sysctl_sched_uclamp_handler(struct ctl_table *table, int write,
> + void *buffer, size_t *lenp, loff_t *ppos);
Here ^^
--
Andrey Ignatov
Powered by blists - more mailing lists