linux-stable/include
Alexei Starovoitov 6fcd486b3a bpf: Refactor RCU enforcement in the verifier.
bpf_rcu_read_lock/unlock() are only available in clang compiled kernels. Lack
of such key mechanism makes it impossible for sleepable bpf programs to use RCU
pointers.

Allow bpf_rcu_read_lock/unlock() in GCC compiled kernels (though GCC doesn't
support btf_type_tag yet) and allowlist certain field dereferences in important
data structures like tast_struct, cgroup, socket that are used by sleepable
programs either as RCU pointer or full trusted pointer (which is valid outside
of RCU CS). Use BTF_TYPE_SAFE_RCU and BTF_TYPE_SAFE_TRUSTED macros for such
tagging. They will be removed once GCC supports btf_type_tag.

With that refactor check_ptr_to_btf_access(). Make it strict in enforcing
PTR_TRUSTED and PTR_UNTRUSTED while deprecating old PTR_TO_BTF_ID without
modifier flags. There is a chance that this strict enforcement might break
existing programs (especially on GCC compiled kernels), but this cleanup has to
start sooner than later. Note PTR_TO_CTX access still yields old deprecated
PTR_TO_BTF_ID. Once it's converted to strict PTR_TRUSTED or PTR_UNTRUSTED the
kfuncs and helpers will be able to default to KF_TRUSTED_ARGS. KF_RCU will
remain as a weaker version of KF_TRUSTED_ARGS where obj refcnt could be 0.

Adjust rcu_read_lock selftest to run on gcc and clang compiled kernels.

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-7-alexei.starovoitov@gmail.com
2023-03-03 17:42:20 +01:00
..
acpi ACPI updates for 6.3-rc1 2023-02-21 12:23:24 -08:00
asm-generic hyperv-next for v6.3. 2023-02-21 16:59:23 -08:00
clocksource
crypto crypto: api - Use data directly in completion function 2023-02-13 18:35:14 +08:00
drm drm/client: fix circular reference counting issue 2023-02-07 09:42:56 +01:00
dt-bindings Thermal control updates for 6.3-rc1 2023-02-21 12:32:05 -08:00
keys
kunit kunit: fix kunit_test_init_section_suites(...) 2023-01-31 09:10:38 -07:00
kvm KVM: arm64: Add helper vgic_write_guest_lock() 2023-01-29 18:46:11 +00:00
linux bpf: Refactor RCU enforcement in the verifier. 2023-03-03 17:42:20 +01:00
math-emu
media platform-drivers-x86 for v6.3-1 2023-02-21 17:32:50 -08:00
memory
misc
net page_pool: add a comment explaining the fragment counter usage 2023-02-21 09:15:39 -08:00
pcmcia
ras
rdma
rv
scsi
soc net: mscc: ocelot: un-export unused regmap symbols 2023-02-06 22:33:15 -08:00
sound
target
trace Networking changes for 6.3. 2023-02-21 18:24:12 -08:00
uapi bpf: Add support for absolute value BPF timers 2023-03-02 22:41:32 -08:00
ufs
vdso vdso/bits.h: Add BIT_ULL() for the sake of consistency 2023-01-31 14:42:10 +01:00
video fbdev: remove w100fb driver 2023-02-01 17:23:38 +01:00
xen xen: Allow platform PCI interrupt to be shared 2023-02-13 06:53:20 +01:00