Leon Hwang
00244bdaa4
bpf: Fix sleepable check for tracing/lsm prog
...
When CONFIG_FUNCTION_ERROR_INJECTION is disabled, a sleepable tracing prog
is allowed to attach to '__x64_'-alike prefix symbols.
It is because the verifier does not verify whether the symbol is a kernel
function or a bpf prog. That said, a sleepable tracing prog is allowed to
attach to a bpf prog target whose name has '__x64_'-alike prefix.
For example, a sleepable fentry prog attaches to a '__x64_sys_nop' XDP
prog, and copies buffer from a user pointer with bpf_copy_from_user()
helper. After attaching the XDP prog to lo interface, the kernel BUG
could be triggered by 'ping -c 1 -W 1 127.0.0.1':
[ 3.460756] BUG: sleeping function called from invalid context at kernel/bpf/trampoline.c:1324
Fix it by disallowing sleepable prog always when its target
btf is not a kernel's btf.
Fixes: 16d9c56606 ("bpf: Always allow sleepable programs on syscalls")
Signed-off-by: Leon Hwang <leon.hwang@linux.dev >
Signed-off-by: Andrii Nakryiko <andrii@kernel.org >
Acked-by: Viktor Malik <vmalik@redhat.com >
Link: https://lore.kernel.org/bpf/20260805150810.34907-2-leon.hwang@linux.dev
2026-08-05 11:39:00 -07:00
..
2026-08-05 11:39:00 -07:00
2026-07-06 12:05:02 -10:00
2026-05-14 10:44:09 +02:00
2026-04-21 16:41:54 +01:00
2026-06-17 12:20:21 -07:00
2026-06-03 11:38:52 +02:00
2026-07-10 12:12:24 +02:00
2026-07-02 22:14:08 +02:00
2026-02-21 20:03:00 -08:00
2026-06-22 22:32:01 +02:00
2026-02-26 09:54:08 -08:00
2026-02-21 17:09:51 -08:00
2026-07-16 09:25:30 +03:00
2026-06-21 11:51:13 +02:00
2026-06-04 16:37:32 +00:00
2026-06-19 10:14:34 -07:00
2026-06-02 15:36:06 +02:00
2026-06-15 13:48:52 +05:30
2026-07-13 15:55:17 -07:00
2026-07-05 11:44:06 +02:00
2026-08-03 00:29:14 +02:00
2026-02-21 20:03:00 -08:00
2025-06-24 20:30:37 +09:00
2026-05-11 23:13:01 +02:00
2026-02-21 17:09:51 -08:00
2026-05-27 19:15:34 -04:00
2026-05-26 17:15:30 -04:00
2026-05-27 19:15:34 -04:00
2026-07-08 14:22:14 -04:00
2026-05-27 19:15:34 -04:00
2026-05-27 19:15:34 -04:00
2026-06-17 12:55:09 +01:00
2025-12-03 16:53:19 +01:00
2025-03-07 22:03:09 -06:00
2025-07-31 18:23:53 -07:00
2026-01-01 16:39:46 +08:00
2025-11-14 10:01:52 +01:00
2026-06-23 16:43:24 -07:00
2025-09-13 17:32:55 -07:00
2026-03-27 21:19:46 -07:00
2026-04-02 23:36:24 -07:00
2026-03-27 21:19:46 -07:00
2026-05-26 11:02:01 +02:00
2026-02-08 00:13:32 -08:00
2026-05-26 11:02:01 +02:00
2026-07-05 11:44:06 +02:00
2026-02-21 17:09:51 -08:00
2026-06-29 15:08:23 -07:00
2025-10-30 20:10:27 +01:00
2025-08-06 10:23:36 +09:00
2026-02-21 01:02:28 -08:00
2026-03-27 21:19:40 -07:00
2025-02-21 15:05:38 +01:00
2026-05-11 16:28:04 +02:00
2026-03-16 13:16:48 +01:00
2026-01-22 15:58:22 -07:00
2026-02-21 17:09:51 -08:00
2026-02-12 12:13:01 -08:00
2025-02-21 10:25:33 +01:00
2025-02-21 09:20:30 +01:00
2025-11-27 14:24:33 -08:00
2026-01-08 12:43:57 +01:00
2026-06-04 14:49:26 -07:00
2026-06-01 09:19:38 +03:00
2025-03-16 22:30:47 -07:00
2026-01-31 16:16:07 -08:00
2025-08-02 12:01:38 -07:00
2026-02-21 17:09:51 -08:00
2024-12-24 09:46:49 +01:00
2026-03-13 23:15:26 +09:00
2025-11-27 15:44:53 +01:00
2026-04-03 19:39:52 +02:00
2026-05-26 11:02:01 +02:00
2025-01-28 13:48:37 +01:00
2026-05-26 11:02:01 +02:00
2026-03-24 21:42:37 +00:00
2024-11-05 17:12:31 -08:00
2026-02-27 22:00:08 +01:00
2026-04-14 19:59:25 -07:00
2026-02-27 22:00:11 +01:00
2026-03-22 11:17:59 +09:00
2026-05-14 10:50:00 -06:00
2026-06-08 23:27:56 +02:00
2026-03-20 14:44:26 +01:00
2025-01-28 13:48:37 +01:00
2026-05-19 08:57:47 +02:00
2026-05-26 11:02:01 +02:00
2026-02-21 01:02:28 -08:00
2026-02-21 17:09:51 -08:00
2026-02-21 17:09:51 -08:00
2026-06-23 12:08:51 -05:00
2026-05-06 17:40:27 +02:00
2026-02-21 17:09:51 -08:00
2025-11-12 10:00:13 -08:00
2026-02-21 17:09:51 -08:00
2026-07-05 11:44:06 +02:00
2026-04-17 09:43:12 -07:00
2025-06-13 08:47:20 +02:00
2026-02-27 16:40:13 +01:00
2026-02-21 17:09:51 -08:00
2026-05-19 12:17:37 +02:00
2026-01-22 11:11:17 +01:00
2026-05-26 11:02:01 +02:00
2025-04-14 14:13:41 +02:00
2026-03-26 09:32:19 +01:00
2025-10-29 10:29:54 +01:00
2026-05-28 21:24:41 -07:00
2026-05-24 09:38:47 +02:00
2026-04-14 05:17:02 -04:00
2026-01-26 19:07:13 -08:00
2026-02-21 17:09:51 -08:00
2026-05-07 11:30:08 -10:00
2026-02-22 08:26:33 -08:00
2025-11-11 10:01:32 +01:00
2025-01-28 13:48:37 +01:00
2025-09-29 11:20:29 -07:00
2026-06-10 02:17:00 -04:00
2026-04-16 20:11:56 -07:00
2026-02-21 17:09:51 -08:00
2026-03-27 21:19:47 -07:00
2026-02-08 00:13:35 -08:00
2026-03-27 21:19:47 -07:00
2026-03-05 07:27:48 -10:00
2026-06-17 11:57:44 +01:00