Skip to content

Commit d08a005

Browse files
committed
tetragon: Allow override when override helper or fmod_ret is available
Currently we won't validate kprobe with override action when the kernel is not compiled with CONFIG_BPF_KPROBE_OVERRIDE. But we can still do override with fmod_ret program if it's available. Fixes: #4157 Reported-by: Shang-Wen Wang <[email protected]> Signed-off-by: Jiri Olsa <[email protected]>
1 parent 9e02513 commit d08a005

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/sensors/tracing/generickprobe.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ func preValidateKprobe(
454454
}
455455

456456
if selectors.HasOverride(f) {
457-
if !bpf.HasOverrideHelper() {
458-
return nil, errors.New("error override action not supported, bpf_override_return helper not available")
457+
if !bpf.HasOverrideHelper() && !bpf.HasModifyReturn() {
458+
return nil, errors.New("error override action not supported, bpf_override_return helper and fmodret are not available")
459459
}
460460
if !f.Syscall {
461461
for idx := range calls {

0 commit comments

Comments
 (0)