Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH bpf-next] bpf: Fix build without BPF_LSM.
@ 2020-08-31 16:31 Alexei Starovoitov
  2020-08-31 17:24 ` Song Liu
  2020-08-31 20:07 ` Daniel Borkmann
  0 siblings, 2 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2020-08-31 16:31 UTC (permalink / raw)
  To: davem; +Cc: daniel, bjorn.topel, netdev, bpf, kernel-team

From: Alexei Starovoitov <ast@kernel.org>

resolve_btfids doesn't like empty set. Add unused ID when BPF_LSM is off.

Reported-by: Björn Töpel <bjorn.topel@gmail.com>
Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs")
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
---
 kernel/bpf/verifier.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 3ebfdb7bd427..b4c22b5ce5a2 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -11008,6 +11008,8 @@ BTF_SET_START(btf_sleepable_lsm_hooks)
 #ifdef CONFIG_BPF_LSM
 BTF_ID(func, bpf_lsm_file_mprotect)
 BTF_ID(func, bpf_lsm_bprm_committed_creds)
+#else
+BTF_ID_UNUSED
 #endif
 BTF_SET_END(btf_sleepable_lsm_hooks)
 
-- 
2.23.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] bpf: Fix build without BPF_LSM.
  2020-08-31 16:31 [PATCH bpf-next] bpf: Fix build without BPF_LSM Alexei Starovoitov
@ 2020-08-31 17:24 ` Song Liu
  2020-08-31 17:40   ` KP Singh
  2020-08-31 20:07 ` Daniel Borkmann
  1 sibling, 1 reply; 4+ messages in thread
From: Song Liu @ 2020-08-31 17:24 UTC (permalink / raw)
  To: Alexei Starovoitov
  Cc: David S. Miller, Daniel Borkmann, Björn Töpel,
	Networking, bpf, Kernel Team



> On Aug 31, 2020, at 9:31 AM, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> 
> From: Alexei Starovoitov <ast@kernel.org>
> 
> resolve_btfids doesn't like empty set. Add unused ID when BPF_LSM is off.
> 
> Reported-by: Björn Töpel <bjorn.topel@gmail.com>
> Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs")
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Thanks for the fix!

Tested-by: Song Liu <songliubraving@fb.com>


> ---
> kernel/bpf/verifier.c | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 3ebfdb7bd427..b4c22b5ce5a2 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c
> @@ -11008,6 +11008,8 @@ BTF_SET_START(btf_sleepable_lsm_hooks)
> #ifdef CONFIG_BPF_LSM
> BTF_ID(func, bpf_lsm_file_mprotect)
> BTF_ID(func, bpf_lsm_bprm_committed_creds)
> +#else
> +BTF_ID_UNUSED
> #endif
> BTF_SET_END(btf_sleepable_lsm_hooks)
> 
> -- 
> 2.23.0
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] bpf: Fix build without BPF_LSM.
  2020-08-31 17:24 ` Song Liu
@ 2020-08-31 17:40   ` KP Singh
  0 siblings, 0 replies; 4+ messages in thread
From: KP Singh @ 2020-08-31 17:40 UTC (permalink / raw)
  To: Song Liu
  Cc: Alexei Starovoitov, David S. Miller, Daniel Borkmann,
	Björn Töpel, Networking, bpf, Kernel Team

On Mon, Aug 31, 2020 at 7:25 PM Song Liu <songliubraving@fb.com> wrote:
>
>
>
> > On Aug 31, 2020, at 9:31 AM, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> >
> > From: Alexei Starovoitov <ast@kernel.org>
> >
> > resolve_btfids doesn't like empty set. Add unused ID when BPF_LSM is off.
> >
> > Reported-by: Björn Töpel <bjorn.topel@gmail.com>
> > Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs")
> > Signed-off-by: Alexei Starovoitov <ast@kernel.org>
>
> Thanks for the fix!
>
> Tested-by: Song Liu <songliubraving@fb.com>

Thanks Björn for reporting and Alexei for fixing!

Acked-by: KP Singh <kpsingh@google.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] bpf: Fix build without BPF_LSM.
  2020-08-31 16:31 [PATCH bpf-next] bpf: Fix build without BPF_LSM Alexei Starovoitov
  2020-08-31 17:24 ` Song Liu
@ 2020-08-31 20:07 ` Daniel Borkmann
  1 sibling, 0 replies; 4+ messages in thread
From: Daniel Borkmann @ 2020-08-31 20:07 UTC (permalink / raw)
  To: Alexei Starovoitov, davem; +Cc: bjorn.topel, netdev, bpf, kernel-team

On 8/31/20 6:31 PM, Alexei Starovoitov wrote:
> From: Alexei Starovoitov <ast@kernel.org>
> 
> resolve_btfids doesn't like empty set. Add unused ID when BPF_LSM is off.
> 
> Reported-by: Björn Töpel <bjorn.topel@gmail.com>
> Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs")
> Signed-off-by: Alexei Starovoitov <ast@kernel.org>

Applied, thanks!

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-31 20:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31 16:31 [PATCH bpf-next] bpf: Fix build without BPF_LSM Alexei Starovoitov
2020-08-31 17:24 ` Song Liu
2020-08-31 17:40   ` KP Singh
2020-08-31 20:07 ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).