BACKPORT: sysctl: pass kernel pointers to ->proc_handler

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.

Change-Id: Ib7ad5ec475ea28257d651bdea23a4026a268c576
Signed-off-by: Christoph Hellwig <[email protected]>
Acked-by: Andrey Ignatov <[email protected]>
Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
Christoph Hellwig 2020-04-24 08:43:38 +02:00 • committed by basamaryan
commit 97a739c638
No known key found for this signature in database
GPG key ID: 210D5384FB2A5885
86 changed files with 458 additions and 639 deletions

View file

@ -269,8 +269,8 @@ static int __init init_lstats_procfs(void)
return 0;
}
int sysctl_latencytop(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos)
int sysctl_latencytop(struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos)
{
int err;