diff options
| author | Sasha Levin <sashal@kernel.org> | 2026-10-19 17:10:06 -0400 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-10-20 00:14:28 +0000 |
| commit | a81bd9262cde4b002b95e652453ce5b815c79a62 (patch) | |
| tree | 144ec03e798fc99fd2a5529277ab6ea7916dfc88 /tools/perf/scripts/python/stackcollapse.py | |
| parent | ced6a0993e2f89158451a1b8651169ac20725aee (diff) | |
bpf: Fix ksock build with BPF_LSM=y and SECURITY_NETWORK=n
bpf_ksock.c references bpf_lsm_socket_sendmsg() whenever
CONFIG_BPF_LSM=y, but the socket LSM hooks, and with them the BPF LSM
socket_sendmsg hook, only exist with CONFIG_SECURITY_NETWORK=y. Without
it resolve_btfids warns:
WARN: resolve_btfids: unresolved symbol bpf_lsm_socket_sendmsg
and since commit 201a454df948 ("resolve_btfids: Fix the --fatal_warnings
exit status") that fails the build with CONFIG_WERROR=y.
Only reference the hook with CONFIG_SECURITY_NETWORK=y, and use
BTF_ID_UNUSED otherwise. The ID stays zero, as it was when unresolved,
so bpf_ksock_kfunc_filter() keeps allowing LSM programs: none can be
attached to socket_sendmsg without CONFIG_SECURITY_NETWORK.
Fixes: 7ae4eb14c5f9 ("bpf: Add ksock kfuncs")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Mahe Tardy <mahe.tardy@gmail.com>
Link: https://patch.msgid.link/20261019211006.2574350-4-sashal@kernel.org
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
