linux-stable/include
Leon Hwang 2b5dcb31a1 bpf, x64: Fix tailcall infinite loop
From commit ebf7d1f508 ("bpf, x64: rework pro/epilogue and tailcall
handling in JIT"), the tailcall on x64 works better than before.

From commit e411901c0b ("bpf: allow for tailcalls in BPF subprograms
for x64 JIT"), tailcall is able to run in BPF subprograms on x64.

From commit 5b92a28aae ("bpf: Support attaching tracing BPF program
to other BPF programs"), BPF program is able to trace other BPF programs.

How about combining them all together?

1. FENTRY/FEXIT on a BPF subprogram.
2. A tailcall runs in the BPF subprogram.
3. The tailcall calls the subprogram's caller.

As a result, a tailcall infinite loop comes up. And the loop would halt
the machine.

As we know, in tail call context, the tail_call_cnt propagates by stack
and rax register between BPF subprograms. So do in trampolines.

Fixes: ebf7d1f508 ("bpf, x64: rework pro/epilogue and tailcall handling in JIT")
Fixes: e411901c0b ("bpf: allow for tailcalls in BPF subprograms for x64 JIT")
Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Leon Hwang <hffilwlqm@gmail.com>
Link: https://lore.kernel.org/r/20230912150442.2009-3-hffilwlqm@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-09-12 13:06:12 -07:00
..
acpi
asm-generic ata changes for 6.6 2023-09-05 12:37:28 -07:00
clocksource
crypto This update includes the following changes: 2023-08-29 11:23:29 -07:00
drm drm for 6.6-rc1 2023-08-30 13:34:34 -07:00
dt-bindings IOMMU Updates for Linux v6.6 2023-09-01 16:54:25 -07:00
keys
kunit - An extensive rework of kexec and crash Kconfig from Eric DeVolder 2023-08-29 14:53:51 -07:00
kvm
linux bpf, x64: Fix tailcall infinite loop 2023-09-12 13:06:12 -07:00
math-emu
media media updates for v6.6-rc1 2023-09-01 12:21:32 -07:00
memory
misc
net Including fixes from netfilter and bpf. 2023-09-07 18:33:07 -07:00
pcmcia
ras
rdma
rv rv: Set variable 'da_mon_##name' to static 2023-09-01 21:00:00 -04:00
scsi SCSI misc on 20230902 2023-09-02 12:02:41 -07:00
soc IOMMU Updates for Linux v6.6 2023-09-01 16:54:25 -07:00
sound
target
trace tracing: Replace strlcpy with strscpy in trace/events/task.h 2023-09-01 21:00:00 -04:00
uapi bpf: Mark BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE deprecated 2023-09-08 08:42:18 -07:00
ufs Merge branch 'fixes' into misc 2023-09-02 08:25:19 +01:00
vdso
video
xen dma-maping updates for Linux 6.6 2023-08-29 20:32:10 -07:00