Message ID | 20221217062144.2507222-1-houtao@huaweicloud.com (mailing list archive) |
---|---|
State | Accepted |
Commit | cc074822465d18a2d39e0b3e2b48b6766a568db2 |
Delegated to: | BPF |
Headers | show |
Series | [bpf-next] bpf: Define sock security related BTF IDs under CONFIG_SECURITY_NETWORK | expand |
On 12/16/22 10:21 PM, Hou Tao wrote: > From: Hou Tao <houtao1@huawei.com> > > There are warnings reported from resolve_btfids when building vmlinux > with CONFIG_SECURITY_NETWORK disabled: > > WARN: resolve_btfids: unresolved symbol bpf_lsm_sk_free_security > WARN: resolve_btfids: unresolved symbol bpf_lsm_sk_alloc_security > > So only define BTF IDs for these LSM hooks when CONFIG_SECURITY_NETWORK > is enabled. > > Signed-off-by: Hou Tao <houtao1@huawei.com> LGTM. I think this patch should go to bpf tree. Acked-by: Yonghong Song <yhs@fb.com>
Hello: This patch was applied to bpf/bpf.git (master) by Daniel Borkmann <daniel@iogearbox.net>: On Sat, 17 Dec 2022 14:21:44 +0800 you wrote: > From: Hou Tao <houtao1@huawei.com> > > There are warnings reported from resolve_btfids when building vmlinux > with CONFIG_SECURITY_NETWORK disabled: > > WARN: resolve_btfids: unresolved symbol bpf_lsm_sk_free_security > WARN: resolve_btfids: unresolved symbol bpf_lsm_sk_alloc_security > > [...] Here is the summary with links: - [bpf-next] bpf: Define sock security related BTF IDs under CONFIG_SECURITY_NETWORK https://git.kernel.org/bpf/bpf/c/cc074822465d You are awesome, thank you!
diff --git a/kernel/bpf/bpf_lsm.c b/kernel/bpf/bpf_lsm.c index 9ea42a45da47..a4a41ee3e80b 100644 --- a/kernel/bpf/bpf_lsm.c +++ b/kernel/bpf/bpf_lsm.c @@ -351,8 +351,10 @@ BTF_ID(func, bpf_lsm_bpf_prog_alloc_security) BTF_ID(func, bpf_lsm_bpf_prog_free_security) BTF_ID(func, bpf_lsm_file_alloc_security) BTF_ID(func, bpf_lsm_file_free_security) +#ifdef CONFIG_SECURITY_NETWORK 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_SET_END(untrusted_lsm_hooks)