Skip to content

bpf: enforce returning 0 for fentry/fexit programs

Yonghong Song bpf 2 versions – Applied

Status from this message: Applied to bpf tree with that typo fixed. Thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesApplied
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

- 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).

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2bpf: enforce returning 0 for fentry/fexit progskernel/bpf/verifier.c+18 -03 replies
2/2selftests/bpf: enforce returning 0 for fentry/fexit programstools/testing/selftests/bpf/progs/test_overhead.c+2 -21 reply

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndrii Nakryiko
1/2A-b
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH bpf v2 0/2] bpf: enforce returning 0 for fentry/fexit programs

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(-)
Signature · 1 line
2.24.1