Currently, tracing fentry/fexit program return value can be anything, and these return values are actually ignored by trampoline codes. Let us force return value to be 0 to avoid confusion and allow possible future extension. Patch #1 is the kernel change and Patch #2 fixed the selftest. Changelog: v1 -> v2: - explicitly specify expected return value ranges for all attach types of the tracing programs. Any unspecified attach type will return an error. This will force any future tracing attach_type to be explicit about its return value range (Andrii). Yonghong Song (2): bpf: enforce returning 0 for fentry/fexit progs selftests/bpf: enforce returning 0 for fentry/fexit programs kernel/bpf/verifier.c | 18 ++++++++++++++++++ .../selftests/bpf/progs/test_overhead.c | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) -- 2.24.1