diff options
| author | Amery Hung <ameryhung@gmail.com> | 2026-07-14 23:40:45 -0700 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-07-15 11:00:47 +0200 |
| commit | 1e63cd6be0557fa1fc57522ec1f681a1dde11078 (patch) | |
| tree | f63eda069e93e88e8042a23c0af6840d67023d0a /tools/perf/scripts/python/bin | |
| parent | 8faaa93b9f6a279472cd5490030151f1635292d2 (diff) | |
selftests/bpf: Test kfunc returning zero-sized allocation buffer
Add a test passing an explicit rdwr_buf_size of 0 to
bpf_kfunc_call_test_get_rdwr_mem() and then reading the returned R0.
R0 should be a zero-sized PTR_TO_MEM, so the access must be rejected
with "min value is outside of the allowed memory range".
This covers the pre-existing bug where a zero size argument was
treated as "no size argument": the verifier fell through to
btf_resolve_size() and sized R0 after the pointed-to return type,
wrongly allowing the read.
Suggested-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Amery Hung <ameryhung@gmail.com>
Link: https://lore.kernel.org/bpf/20260715064047.1793790-6-ameryhung@gmail.com
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions
