Re: [linux-next-20260327]resolve_btfids warnings for unresolved bpf_lsm_bdev_* symbols

Jiri Olsa
2026-03-30T19:55:26Z

On Mon, Mar 30, 2026 at 07:42:18AM -0700, Alexei Starovoitov wrote:
> On Mon, Mar 30, 2026 at 6:45 AM Venkat Rao Bagalkote
> <venkat88@linux.ibm.com> wrote:
> >
> > Hi,
> >
> >
> > While testing linux-next, I’m seeing the following warnings during the
> > build:
> >
> >
> > WARN: resolve_btfids: unresolved symbol bpf_lsm_bdev_free
> >
> > WARN: resolve_btfids: unresolved symbol bpf_lsm_bdev_alloc
> >
>
> Christian,
>
> looks like those two need some #ifdef
>

I think it's wrong hooks name, this fixes it for me

jirka

---
diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c
index 119e3942cf5a..0e74325d96a6 100644
--- a/kernel/bpf/bpf_lsm.c
+++ b/kernel/bpf/bpf_lsm.c
@@ -383,7 +383,7 @@ BTF_ID(func, bpf_lsm_task_prctl)
BTF_ID(func, bpf_lsm_task_setscheduler)
BTF_ID(func, bpf_lsm_task_to_inode)
BTF_ID(func, bpf_lsm_userns_create)
-BTF_ID(func, bpf_lsm_bdev_alloc)
+BTF_ID(func, bpf_lsm_bdev_alloc_security)
BTF_ID(func, bpf_lsm_bdev_setintegrity)
BTF_SET_END(sleepable_lsm_hooks)

@@ -397,8 +397,8 @@ BTF_ID(func, bpf_lsm_sk_alloc_security)
BTF_ID(func, bpf_lsm_sk_free_security)
#endif /* CONFIG_SECURITY_NETWORK */
BTF_ID(func, bpf_lsm_task_free)
-BTF_ID(func, bpf_lsm_bdev_alloc)
-BTF_ID(func, bpf_lsm_bdev_free)
+BTF_ID(func, bpf_lsm_bdev_alloc_security)
+BTF_ID(func, bpf_lsm_bdev_free_security)
BTF_SET_END(untrusted_lsm_hooks)

bool bpf_lsm_is_sleepable_hook(u32 btf_id)