mbox series

[bpf,v1,0/4] Explicit raw_tp NULL arguments

Message ID 20241211020156.18966-1-memxor@gmail.com (mailing list archive)
Headers show
Series Explicit raw_tp NULL arguments | expand

Message

Kumar Kartikeya Dwivedi Dec. 11, 2024, 2:01 a.m. UTC
This set reverts the raw_tp masking hack introduced in commit
cb4158ce8ec8 ("bpf: Mark raw_tp arguments with PTR_MAYBE_NULL")
and replaces it wwith an explicit list of tracepoints and their
arguments which need to be annotated as PTR_MAYBE_NULL. More context
on the fallout caused by the masking fix and subsequent discussions can
be found in [0].

The set begins by reverting the fix and its associated selftest,
then introduces a new method of defining tracepoints with NULL
argument(s), and adds a script to autogenerate tests for all such
tracepoints. For tracepoints that are not available due to missing
CONFIG_ options, the testing is skipped by commenting them out.
However, to expand coverage for different cases, some additional config
options are introduced which do not introduce too many dependencies.

Kumar Kartikeya Dwivedi (4):
  bpf: Revert "bpf: Mark raw_tp arguments with PTR_MAYBE_NULL"
  selftests/bpf: Revert "selftests/bpf: Add tests for raw_tp null
    handling"
  bpf: Augment raw_tp arguments with PTR_MAYBE_NULL
  selftests/bpf: Add autogenerated tests for raw_tp NULL args

 include/linux/bpf.h                           |   6 -
 kernel/bpf/btf.c                              | 134 +++++-
 kernel/bpf/verifier.c                         |  79 +---
 .../bpf/bpf_testmod/bpf_testmod-events.h      |   8 -
 .../selftests/bpf/bpf_testmod/bpf_testmod.c   |   2 -
 tools/testing/selftests/bpf/config            |   5 +
 .../testing/selftests/bpf/gen_raw_tp_null.py  |  58 +++
 .../testing/selftests/bpf/gen_raw_tp_null.sh  |   3 +
 .../selftests/bpf/prog_tests/raw_tp_null.c    |  19 +-
 .../testing/selftests/bpf/progs/raw_tp_null.c | 431 +++++++++++++++++-
 .../selftests/bpf/progs/raw_tp_scalar.c       |  24 +
 .../bpf/progs/test_tp_btf_nullable.c          |   6 +-
 12 files changed, 639 insertions(+), 136 deletions(-)
 create mode 100755 tools/testing/selftests/bpf/gen_raw_tp_null.py
 create mode 100755 tools/testing/selftests/bpf/gen_raw_tp_null.sh
 create mode 100644 tools/testing/selftests/bpf/progs/raw_tp_scalar.c


base-commit: 7d0d673627e20cfa3b21a829a896ce03b58a4f1c