bpf: Rename __kptr_ref -> __kptr and __kptr -> __kptr_untrusted.
authorAlexei Starovoitov <ast@kernel.org>
Fri, 3 Mar 2023 04:14:41 +0000 (20:14 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 3 Mar 2023 16:42:20 +0000 (17:42 +0100)
commit03b77e17aeb22a5935ea20d585ca6a1f2947e62b
tree05dc31ff00b9fb0aabb5709080a5d72eb06d0d66
parent944459e88b4f5c71683b56710f96e39756afae31
bpf: Rename __kptr_ref -> __kptr and __kptr -> __kptr_untrusted.

__kptr meant to store PTR_UNTRUSTED kernel pointers inside bpf maps.
The concept felt useful, but didn't get much traction,
since bpf_rdonly_cast() was added soon after and bpf programs received
a simpler way to access PTR_UNTRUSTED kernel pointers
without going through restrictive __kptr usage.

Rename __kptr_ref -> __kptr and __kptr -> __kptr_untrusted to indicate
its intended usage.
The main goal of __kptr_untrusted was to read/write such pointers
directly while bpf_kptr_xchg was a mechanism to access refcnted
kernel pointers. The next patch will allow RCU protected __kptr access
with direct read. At that point __kptr_untrusted will be deprecated.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: David Vernet <void@manifault.com>
Link: https://lore.kernel.org/bpf/20230303041446.3630-2-alexei.starovoitov@gmail.com
14 files changed:
Documentation/bpf/bpf_design_QA.rst
Documentation/bpf/cpumasks.rst
Documentation/bpf/kfuncs.rst
kernel/bpf/btf.c
tools/lib/bpf/bpf_helpers.h
tools/testing/selftests/bpf/progs/cb_refs.c
tools/testing/selftests/bpf/progs/cgrp_kfunc_common.h
tools/testing/selftests/bpf/progs/cpumask_common.h
tools/testing/selftests/bpf/progs/jit_probe_mem.c
tools/testing/selftests/bpf/progs/lru_bug.c
tools/testing/selftests/bpf/progs/map_kptr.c
tools/testing/selftests/bpf/progs/map_kptr_fail.c
tools/testing/selftests/bpf/progs/task_kfunc_common.h
tools/testing/selftests/bpf/test_verifier.c