bpf: Fix build without BPF_LSM.
authorAlexei Starovoitov <ast@kernel.org>
Mon, 31 Aug 2020 16:31:32 +0000 (09:31 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 31 Aug 2020 18:56:10 +0000 (20:56 +0200)
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 <bjorn.topel@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Tested-by: Song Liu <songliubraving@fb.com>
Acked-by: KP Singh <kpsingh@google.com>
Link: https://lore.kernel.org/bpf/20200831163132.66521-1-alexei.starovoitov@gmail.com
kernel/bpf/verifier.c

index 3ebfdb7bd42736fb671e781f4037de21dacf8df4..b4c22b5ce5a2b0cc90ff55c0fb8d56705d65af78 100644 (file)
@@ -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)