summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAmery Hung <ameryhung@gmail.com>2026-09-11 15:04:03 -0700
committerAlexei Starovoitov <ast@kernel.org>2026-09-11 20:16:03 -0700
commit2b2b08c277cb2ba2596e88d6a2efdb9df3117b75 (patch)
tree8d3710af7aec94d346cb6a3c3b38f987f56077b0 /include/linux
parent78811eac7ae6e4510827f320d780b3c417601142 (diff)
downloadlinux-next-2b2b08c277cb2ba2596e88d6a2efdb9df3117b75.tar.gz
linux-next-2b2b08c277cb2ba2596e88d6a2efdb9df3117b75.zip
bpf: Set MEM_RCU when generating kfunc argument types
The BTF ID argument of a kfunc has to be referenced or trusted unless the kfunc is KF_RCU, in which case an RCU-protected pointer is accepted too. check_kfunc_args() reads that off meta->kfunc_flags on every verification of the call, which is the last thing keeping the argument policy of ARG_PTR_TO_BTF_ID out of the generated prototype. Set MEM_RCU in get_kfunc_arg_type() for ARG_PTR_TO_BTF_ID arguments of KF_RCU kfuncs, the way it already sets OBJ_RELEASE for release arguments, and test the generated flag instead. MEM_RCU represents the KF_RCU relaxation applied by the ARG_PTR_TO_BTF_ID trust check; other argument kinds have their own provenance requirements. No functional change intended. Signed-off-by: Amery Hung <ameryhung@gmail.com> Link: https://lore.kernel.org/r/20260911220415.1396439-12-ameryhung@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions