diff options
| author | Eduard Zingerman <eddyz87@gmail.com> | 2026-09-21 04:38:26 +0200 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-21 17:12:39 +0000 |
| commit | e2b4aaa75040dd68f97dce8a7218e088243666b0 (patch) | |
| tree | 9123bb7c52034ce7f1b549137a5b2d3edf32fe4e /tools/testing/selftests/bpf/test_cpp.cpp | |
| parent | 06046a8a50e85165cfe4cf1b99ac4c0d43781189 (diff) | |
| download | linux-next-e2b4aaa75040dd68f97dce8a7218e088243666b0.tar.gz linux-next-e2b4aaa75040dd68f97dce8a7218e088243666b0.zip | |
bpf: Record raw memory arguments during argument checking
Record raw outputs in check_func_arg() after resolving their memory type,
instead of pre-recording them in check_raw_mode_ok(). Keep prototype
validation separate from per-call output tracking so kfuncs can share the
latter in a following patch.
For bpf_strtol(), bpf_strtoul() and bpf_kallsyms_lookup_name(), a variable-size
input is checked before the arg4 output. Recording outputs as their arguments
are checked prevents that input from clearing the output's raw mode early.
Only clear raw mode when a variable size belongs to the recorded output:
an unrelated later input must also preserve an earlier output descriptor.
For bpf_map_peek_elem() on a bloom filter, type resolution removes MEM_UNINIT
and MEM_WRITE because the value is an input. Recording the resolved type makes
the later bloom-filter-specific raw-mode reset unnecessary. Reuse the same
raw-memory predicate for output recording and prototype validation.
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260921023843.411943-3-memxor@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_cpp.cpp')
0 files changed, 0 insertions, 0 deletions
