summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/test_cpp.cpp
diff options
context:
space:
mode:
authorEduard Zingerman <eddyz87@gmail.com>2026-09-21 04:38:26 +0200
committerAlexei Starovoitov <ast@kernel.org>2026-09-21 17:12:39 +0000
commite2b4aaa75040dd68f97dce8a7218e088243666b0 (patch)
tree9123bb7c52034ce7f1b549137a5b2d3edf32fe4e /tools/testing/selftests/bpf/test_cpp.cpp
parent06046a8a50e85165cfe4cf1b99ac4c0d43781189 (diff)
downloadlinux-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