bpf: reject direct access to nullable PTR_TO_BUF pointers
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest2 patches 4 repliesIn review 1 of 2 applied
- v32 patches 2 repliesSuperseded
- v21 patch 1 replySuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 1 patch | 2 replies | Superseded |
Changes in v4 from the cover letter
- Add test runner in prog_tests/ so the test is actually invoked by test_progs (Kumar)
Patches in v4 1 of 2 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: reject direct access to nullable PTR_TO_BUF pointerskernel/ | +2 | 1 reply | Applied |
| 2/2 | selftests/bpf: add test for nullable PTR_TO_BUF accesstools/ tools/ | +60 | 3 replies |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Kumar Kartikeya Dwivedi | Amery Hung |
|---|---|---|
| 1/2 | A-b | R-b |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH bpf v4 0/2] bpf: reject direct access to nullable PTR_TO_BUF pointers
check_mem_access() allows direct dereference of PTR_TO_BUF | PTR_MAYBE_NULL without a null check, causing kernel NULL dereference on map iterator stop callbacks.
Patch 1 adds the missing type_may_be_null() guard. Patch 2 adds a selftest with a test runner.
Changes in v4:
- Add test runner in prog_tests/ so the test is actually invoked by test_progs (Kumar)
Changes in v3:
- Drop stack trace from commit log
- Split kernel fix and selftest into separate patches
- Use [PATCH bpf] prefix
Changes in v2:
- Add selftest
Qi Tang (2):
bpf: reject direct access to nullable PTR_TO_BUF pointers selftests/bpf: add test for nullable PTR_TO_BUF access
kernel/bpf/verifier.c | 3 ++- tools/testing/selftests/bpf/prog_tests/iter_buf_null_fail.c | 9 +++++++++ tools/testing/selftests/bpf/progs/iter_buf_null_fail.c | 51 ++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 tools/testing/selftests/bpf/prog_tests/iter_buf_null_fail.c create mode 100644 tools/testing/selftests/bpf/progs/iter_buf_null_fail.c