]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf: attribute __arg_untrusted for global function parameters
authorEduard Zingerman <eddyz87@gmail.com>
Fri, 4 Jul 2025 23:03:50 +0000 (16:03 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 7 Jul 2025 15:25:06 +0000 (08:25 -0700)
commit182f7df70419f368c4310dc151677d574e53c44a
tree845b14e07a40c56f8e333e936498ca85b4117ddd
parentf1f5d6f25d098e21b0a53237cfd055fc28787c46
bpf: attribute __arg_untrusted for global function parameters

Add support for PTR_TO_BTF_ID | PTR_UNTRUSTED global function
parameters. Anything is allowed to pass to such parameters, as these
are read-only and probe read instructions would protect against
invalid memory access.

Suggested-by: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Acked-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20250704230354.1323244-5-eddyz87@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/btf.c
kernel/bpf/verifier.c