Skip to content
Commit ef331a8d authored by Hou Tao's avatar Hou Tao Committed by Martin KaFai Lau
Browse files

bpf: Only add BTF IDs for socket security hooks when CONFIG_SECURITY_NETWORK is on

When CONFIG_SECURITY_NETWORK is disabled, there will be build warnings
from resolve_btfids:

  WARN: resolve_btfids: unresolved symbol bpf_lsm_socket_socketpair
  ......
  WARN: resolve_btfids: unresolved symbol bpf_lsm_inet_conn_established

Fixing it by wrapping these BTF ID definitions by CONFIG_SECURITY_NETWORK.

Fixes: 69fd337a ("bpf: per-cgroup lsm flavor")
Fixes: 9113d7e4

 ("bpf: expose bpf_{g,s}etsockopt to lsm cgroup")
Signed-off-by: default avatarHou Tao <houtao1@huawei.com>
Link: https://lore.kernel.org/r/20220901065126.3856297-1-houtao@huaweicloud.com
Signed-off-by: default avatarMartin KaFai Lau <martin.lau@kernel.org>
parent ccf365ea
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment