Re: [PATCH bpf] bpf, sysctl: let bpf_stats_handler take a kernel pointer buffer

From: Alexei Starovoitov
Date: Tue Aug 25 2020 - 00:15:06 EST


On Mon, Aug 24, 2020 at 7:20 AM Tobias Klauser <tklauser@xxxxxxxxxx> wrote:
>
> Commit 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
> changed ctl_table.proc_handler to take a kernel pointer. Adjust the
> signature of bpf_stats_handler to match ctl_table.proc_handler which
> fixes the following sparse warning:
>
> kernel/sysctl.c:226:49: warning: incorrect type in argument 3 (different address spaces)
> kernel/sysctl.c:226:49: expected void *
> kernel/sysctl.c:226:49: got void [noderef] __user *buffer
> kernel/sysctl.c:2640:35: warning: incorrect type in initializer (incompatible argument 3 (different address spaces))
> kernel/sysctl.c:2640:35: expected int ( [usertype] *proc_handler )( ... )
> kernel/sysctl.c:2640:35: got int ( * )( ... )
>
> Fixes: 32927393dc1c ("sysctl: pass kernel pointers to ->proc_handler")
> Cc: Christoph Hellwig <hch@xxxxxx>
> Signed-off-by: Tobias Klauser <tklauser@xxxxxxxxxx>

Applied. Thanks