[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20191219162051.GA11015@linux-9.fritz.box>
Date: Thu, 19 Dec 2019 17:20:51 +0100
From: Daniel Borkmann <daniel@...earbox.net>
To: Alexander Lobakin <alobakin@...nk.ru>
Cc: "David S. Miller" <davem@...emloft.net>,
Alexei Starovoitov <ast@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
Andrii Nakryiko <andriin@...com>,
Eric Dumazet <edumazet@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Soheil Hassas Yeganeh <soheil@...gle.com>,
Aaron Tomlin <atomlin@...hat.com>,
Matteo Croce <mcroce@...hat.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Edward Cree <ecree@...arflare.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, bpf@...r.kernel.org
Subject: Re: [PATCH net] net: core: sysctl: fix compiler warning when only
cBPF is present
On Wed, Dec 18, 2019 at 12:18:21PM +0300, Alexander Lobakin wrote:
> proc_dointvec_minmax_bpf_restricted() has been firstly introduced
> in commit 2e4a30983b0f ("bpf: restrict access to core bpf sysctls")
> under CONFIG_HAVE_EBPF_JIT. Then, this ifdef has been removed in
> ede95a63b5e8 ("bpf: add bpf_jit_limit knob to restrict unpriv
> allocations"), because a new sysctl, bpf_jit_limit, made use of it.
> Finally, this parameter has become long instead of integer with
> fdadd04931c2 ("bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K")
> and thus, a new proc_dolongvec_minmax_bpf_restricted() has been
> added.
> With this last change, we got back to that
> proc_dointvec_minmax_bpf_restricted() is used only under
> CONFIG_HAVE_EBPF_JIT, but the corresponding ifdef has not been
> brought back.
>
> So, in configurations like CONFIG_BPF_JIT=y && CONFIG_HAVE_EBPF_JIT=n
> since v4.20 we have:
>
> CC net/core/sysctl_net_core.o
> net/core/sysctl_net_core.c:292:1: warning: ‘proc_dointvec_minmax_bpf_restricted’ defined but not used [-Wunused-function]
> 292 | proc_dointvec_minmax_bpf_restricted(struct ctl_table *table, int write,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Suppress this by guarding it with CONFIG_HAVE_EBPF_JIT again.
>
> Fixes: fdadd04931c2 ("bpf: fix bpf_jit_limit knob for PAGE_SIZE >= 64K")
> Signed-off-by: Alexander Lobakin <alobakin@...nk.ru>
Applied, thanks!
Powered by blists - more mailing lists