linux-stable/include
Martin KaFai Lau a12f15d1f8 bpf: Remove prog->active check for bpf_lsm and bpf_iter
[ Upstream commit 271de525e1 ]

The commit 64696c40d0 ("bpf: Add __bpf_prog_{enter,exit}_struct_ops for struct_ops trampoline")
removed prog->active check for struct_ops prog.  The bpf_lsm
and bpf_iter is also using trampoline.  Like struct_ops, the bpf_lsm
and bpf_iter have fixed hooks for the prog to attach.  The
kernel does not call the same hook in a recursive way.
This patch also removes the prog->active check for
bpf_lsm and bpf_iter.

A later patch has a test to reproduce the recursion issue
for a sleepable bpf_lsm program.

This patch appends the '_recur' naming to the existing
enter and exit functions that track the prog->active counter.
New __bpf_prog_{enter,exit}[_sleepable] function are
added to skip the prog->active tracking. The '_struct_ops'
version is also removed.

It also moves the decision on picking the enter and exit function to
the new bpf_trampoline_{enter,exit}().  It returns the '_recur' ones
for all tracing progs to use.  For bpf_lsm, bpf_iter,
struct_ops (no prog->active tracking after 64696c40d0), and
bpf_lsm_cgroup (no prog->active tracking after 69fd337a97),
it will return the functions that don't track the prog->active.

Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20221025184524.3526117-2-martin.lau@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Stable-dep-of: 7645629f7d ("bpf: Invoke __bpf_prog_exit_sleepable_recur() on recursion in kern_sys_bpf().")
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-19 12:28:03 +02:00
..
acpi ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep() 2023-06-28 11:12:22 +02:00
asm-generic word-at-a-time: use the same return type for has_zero regardless of endianness 2023-08-11 12:08:11 +02:00
clocksource
crypto crypto: api - Use work queue in crypto_destroy_instance 2023-09-13 09:42:32 +02:00
drm drm/display/dp: Fix the DP DSC Receiver cap size 2023-08-30 16:11:09 +02:00
dt-bindings dt-bindings: clock: qcom,gcc-sc8280xp: Add missing GDSCs 2023-09-13 09:42:45 +02:00
keys
kunit
kvm KVM: arm64: vgic-v4: Make the doorbell request robust w.r.t preemption 2023-08-23 17:52:28 +02:00
linux bpf: Remove prog->active check for bpf_lsm and bpf_iter 2023-09-19 12:28:03 +02:00
math-emu
media media: cec: core: add adap_unconfigured() callback 2023-09-13 09:42:54 +02:00
memory
misc
net ip_tunnels: use DEV_STATS_INC() 2023-09-19 12:28:03 +02:00
pcmcia
ras
rdma RDMA/cma: Always set static rate to 0 for RoCE 2023-06-21 16:00:59 +02:00
rv
scsi scsi: core: Use 32-bit hostnum in scsi_host_lookup() 2023-09-13 09:42:56 +02:00
soc net: mscc: ocelot: don't keep PTP configuration of all ports in single structure 2023-07-19 16:22:01 +02:00
sound ASoC: Intel: avs: Account for UID of ACPI device 2023-06-21 16:00:53 +02:00
target
trace jbd2: remove journal_clean_one_cp_list() 2023-08-30 16:10:58 +02:00
uapi dma-buf/sync_file: Fix docs syntax 2023-09-13 09:42:53 +02:00
ufs
vdso
video
xen