From: Alexei Starovoitov Date: Mon, 31 Aug 2020 16:31:32 +0000 (-0700) Subject: bpf: Fix build without BPF_LSM. X-Git-Tag: io_uring-5.10-2020-10-20~32^2~394^2~19 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=29523c5e6716521f6e2fb59d7785e2bc0b1a993a;p=linux-block.git bpf: Fix build without BPF_LSM. resolve_btfids doesn't like empty set. Add unused ID when BPF_LSM is off. Fixes: 1e6c62a88215 ("bpf: Introduce sleepable BPF programs") Reported-by: Björn Töpel Signed-off-by: Alexei Starovoitov Signed-off-by: Daniel Borkmann Tested-by: Song Liu Acked-by: KP Singh Link: https://lore.kernel.org/bpf/20200831163132.66521-1-alexei.starovoitov@gmail.com --- 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)