Skip to contentSkip to conversation

bpf: lsm: Make BPF_LSM depend on BPF_EVENTS

PATCH Applied KP Singh 3 participants 3 messages Mar 30, 2020 BPF

lore
Share & tools
lore

KP Singh

author
#0 lore raw

PATCH 1/1 bpf: lsm: Make BPF_LSM depend on BPF_EVENTS

From: KP Singh <[email protected]>

LSM and tracing programs share their helpers with bpf_tracing_func_proto which is only defined (in bpf_trace.c) when BPF_EVENTS is enabled.

Instead of adding __weak symbol, make BPF_LSM depend on BPF_EVENTS so that both tracing and LSM programs can actually share helpers.

Fixes fc611f47f218 ("bpf: Introduce BPF_PROG_TYPE_LSM")
---
 init/Kconfig | 1 +
 1 file changed, 1 insertion(+)
init/Kconfig +1 -0
index deae572d1927..7b7ea70e64ac 100644
@@ -1619,6 +1619,7 @@ config KALLSYMS_BASE_RELATIVE
 
 config BPF_LSM
 	bool "LSM Instrumentation with BPF"
+	depends on BPF_EVENTS
 	depends on BPF_SYSCALL
 	depends on SECURITY
 	depends on BPF_JIT
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 5 lines · KP Singh

From: KP Singh <[email protected]>

LSM and tracing programs share their helpers with bpf_tracing_func_proto which is only defined (in bpf_trace.c) when BPF_EVENTS is enabled.

Quoted 7 lines

Instead of adding __weak symbol, make BPF_LSM depend on BPF_EVENTS so that both tracing and LSM programs can actually share helpers.

Fixes fc611f47f218 ("bpf: Introduce BPF_PROG_TYPE_LSM")

Applied, thanks!

Acked-by
#2 lore raw
Quoted 10 lines · Daniel Borkmann
Quoted 9 lines · KP Singh

From: KP Singh <[email protected]>

LSM and tracing programs share their helpers with bpf_tracing_func_proto which is only defined (in bpf_trace.c) when BPF_EVENTS is enabled.

Instead of adding __weak symbol, make BPF_LSM depend on BPF_EVENTS so that both tracing and LSM programs can actually share helpers.

Quoted 5 lines
Quoted 3 lines
Fixes fc611f47f218 ("bpf: Introduce BPF_PROG_TYPE_LSM")

Applied, thanks!

thanks.

Signature · 1 line
~Randy