diff options
| author | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-09-21 04:38:27 +0200 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2026-09-21 17:12:39 +0000 |
| commit | fc8dc2be101b038adf6c36c51511a53ca2407199 (patch) | |
| tree | 229188d41e8b14efa1abbc2cd688a613aa074d14 /tools/testing/selftests/bpf/test_cpp.cpp | |
| parent | e2b4aaa75040dd68f97dce8a7218e088243666b0 (diff) | |
| download | linux-next-fc8dc2be101b038adf6c36c51511a53ca2407199.tar.gz linux-next-fc8dc2be101b038adf6c36c51511a53ca2407199.zip | |
bpf: Check __uninit kfunc output buffers as write-only
Generic kfunc memory arguments are checked for both read and write access,
including __uninit outputs. An output pointing into a write-only map value
is therefore rejected, and a stack output must already hold readable
contents even though the kfunc only writes it.
Mark generic buffers in generated kfunc prototypes with MEM_WRITE, and keep
MEM_UNINIT when a struct pointer resolves to generic memory. Check __uninit
buffers as write-only while ordinary kfunc buffers retain read/write
access. Helper access selection is unchanged. Definite initialization of
stack outputs after the call is addressed separately.
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://patch.msgid.link/20260921023843.411943-4-memxor@gmail.com
Diffstat (limited to 'tools/testing/selftests/bpf/test_cpp.cpp')
0 files changed, 0 insertions, 0 deletions
