Leon Hwang and Alexei Starovoitov
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
..
2023-08-31 14:56:27 +02:00
2023-08-22 14:13:11 -07:00
2023-09-01 09:53:54 -07:00
2023-08-22 16:32:35 +02:00
2023-09-01 09:53:54 -07:00
2023-08-29 17:45:22 -04:00
2023-09-04 13:47:59 -07:00
2023-08-23 08:25:28 +01:00
2023-08-27 17:08:45 -07:00
2023-08-25 11:45:51 +02:00
2023-08-28 16:37:38 +02:00
2023-08-25 07:42:58 +01:00
2023-09-01 08:09:48 -07:00
2023-09-07 16:07:35 -07:00
2023-08-23 08:21:37 +01:00
2023-08-18 13:58:05 +01:00
2023-08-29 14:53:51 -07:00
2023-08-30 19:53:39 -07:00
2023-09-03 10:20:57 -07:00
2023-08-21 14:29:35 +01:00
2023-08-31 15:36:41 -07:00
2023-09-01 09:23:34 -07:00
2023-08-25 20:55:47 +02:00
2023-08-18 10:18:56 -07:00
2023-08-18 10:18:56 -07:00
2023-08-31 01:29:28 +02:00
2023-08-21 13:38:01 -07:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2023-08-29 20:21:42 -07:00
2023-09-08 08:42:17 -07:00
2023-09-12 13:06:12 -07:00
2023-09-02 11:10:50 -07:00
2023-08-29 20:21:42 -07:00
2023-08-24 16:20:25 -07:00
2023-09-01 15:58:21 -07:00
2023-08-22 13:51:26 -07:00
2023-08-17 16:46:35 -07:00
2023-08-28 15:04:43 -07:00
2023-08-29 20:51:40 +02:00
2023-08-24 16:25:13 -07:00
2023-08-21 13:37:37 -07:00
2023-08-24 16:20:30 -07:00
2023-09-01 09:43:18 -07:00
2023-08-25 16:07:30 -07:00
2023-08-30 13:34:34 -07:00
2023-08-23 14:17:42 -07:00
2023-09-01 00:29:34 +02:00
2023-08-28 11:04:18 -07:00
2023-08-31 12:47:15 +02:00
2023-08-22 05:20:34 -04:00
2023-08-18 10:18:57 -07:00
2023-08-18 10:18:57 -07:00
2023-08-31 10:38:03 +02:00
2023-08-18 10:12:29 -07:00
2023-08-21 14:28:43 -07:00
2023-08-21 14:28:43 -07:00
2023-09-04 11:26:29 -07:00
2023-08-22 21:43:27 +02:00
2023-08-25 08:08:27 +01:00
2023-09-07 11:19:36 -07:00
2023-08-22 01:11:32 +03:00
2023-08-24 17:16:20 -06:00
2023-08-29 20:21:42 -07:00
2023-09-01 16:54:25 -07:00
2023-08-18 10:12:35 -07:00
2023-09-01 08:11:51 +01:00
2023-08-21 13:46:24 -07:00
2023-08-24 16:25:14 -07:00
2023-08-18 10:12:39 -07:00
2023-08-18 10:12:10 -07:00
2023-08-18 10:18:59 -07:00
2023-08-31 13:48:50 -04:00
2023-08-18 10:19:00 -07:00
2023-08-30 09:07:09 -07:00
2023-08-24 16:20:32 -07:00
2023-08-18 10:18:59 -07:00
2023-08-21 13:37:47 -07:00
2023-08-29 14:25:26 -07:00
2023-08-21 13:37:48 -07:00
2023-08-18 10:12:11 -07:00
2023-08-21 13:37:49 -07:00
2023-09-06 20:49:04 -07:00
2023-08-30 13:45:05 -07:00
2023-08-18 10:12:16 -07:00
2023-08-18 10:12:36 -07:00
2023-08-24 16:20:28 -07:00
2023-08-31 12:20:12 -07:00
2023-08-18 10:12:46 -07:00
2023-08-18 10:12:41 -07:00
2023-08-18 10:12:12 -07:00
2023-08-18 10:19:00 -07:00
2023-08-21 11:29:12 -07:00
2023-08-23 16:34:02 +02:00
2023-09-05 13:02:13 -05:00
2023-08-21 13:37:31 -07:00
2023-08-18 10:12:25 -07:00
2023-08-24 16:20:18 -07:00
2023-08-21 14:28:45 -07:00
2023-08-29 14:25:26 -07:00
2023-08-21 13:07:20 -07:00
2023-09-01 09:38:00 -07:00
2023-08-30 20:23:07 -07:00
2023-08-25 08:06:53 -07:00
2023-09-01 08:09:48 -07:00
2023-08-31 12:20:12 -07:00
2023-09-06 07:46:49 +01:00
2023-08-21 13:37:59 -07:00
2023-08-22 21:31:57 +02:00
2023-08-22 22:03:43 +02:00
2023-08-21 18:58:09 +03:00
2023-08-24 21:34:28 -04:00
2023-08-18 10:19:00 -07:00
2023-09-02 15:17:33 -07:00
2023-08-27 23:50:22 +02:00
2023-08-30 10:08:38 +02:00
2023-08-24 16:20:31 -07:00
2023-08-30 09:07:09 -07:00
2023-08-22 11:10:26 -06:00
2023-08-20 14:29:37 +02:00
2023-08-20 15:17:47 +01:00
2023-08-21 13:46:24 -07:00
2023-08-28 12:55:04 -07:00
2023-08-24 16:20:28 -07:00
2023-08-21 13:37:26 -07:00
2023-08-18 10:12:16 -07:00
2023-08-31 12:20:12 -07:00
2023-08-29 20:48:35 +02:00
2023-09-01 16:34:25 -07:00
2023-08-22 14:58:15 +02:00
2023-08-22 14:58:15 +02:00
2023-08-27 11:47:44 +02:00
2023-08-18 10:12:16 -07:00
2023-09-03 18:10:22 -04:00
2023-08-24 13:27:47 -05:00
2023-09-04 13:44:11 -07:00
2023-08-21 14:52:16 +02:00
2023-08-21 13:37:27 -07:00