Daniel Borkmann
d99bda7f01
bpf: Rewrite any fault prone load out of a mem or btf_id pointer
...
bpf_convert_ctx_accesses() turns a BPF_LDX into a BPF_PROBE_MEM one by
matching the type recorded for the insn against a list of exact pointer
types. The list cannot keep up with the flag combinations the verifier
produces, and a type which is missing from it ends up as a plain load
without an exception table entry, so a bad address panics the kernel
instead of being handled.
Two such types exist today and are reachable:
- PTR_TO_BTF_ID | PTR_UNTRUSTED | MEM_ALLOC | NON_OWN_REF
- PTR_TO_BTF_ID | PTR_UNTRUSTED | MEM_RCU
Rather than adding the two, just drop the list and state the property
itself in the default case of the switch. This is a superset of what
the list matched, the untrusted PTR_TO_MEM does not have to carry
MEM_RDONLY for it anymore, and it stays in sync with the verifier side
which uses the same match in save_aux_ptr_type() and reg_type_mismatch_ok().
Assert that a fault prone type which does not get the rewrite for whatever
reason is rejected at load time rather than left to fault at runtime to
catch any future cases.
Fixes: 1b12171533 ("bpf: Mark direct ld of stashed bpf_{rb,list}_node as non-owning ref")
Fixes: 6fcd486b3a ("bpf: Refactor RCU enforcement in the verifier.")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net >
Acked-by: Eduard Zingerman <eddyz87@gmail.com >
Link: https://lore.kernel.org/bpf/20260814215301.709827-4-daniel@iogearbox.net
2026-08-17 10:06:42 +02:00
..
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-23 10:24:12 -07:00
2026-07-16 09:12:24 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:14 +02:00
2026-07-03 07:37:43 +02:00
2026-07-02 21:20:10 +05:30
2026-07-14 16:33:21 -05:00
2026-06-18 08:50:52 -07:00
2026-07-03 07:38:16 +02:00
2026-06-11 10:26:40 +02:00
2026-07-03 07:38:16 +02:00
2026-06-23 15:51:14 -07:00
2026-06-17 11:32:14 +01:00
2026-07-23 08:19:29 -07:00
2026-07-03 07:38:16 +02:00
2026-06-21 17:05:45 +02:00
2026-07-31 15:58:08 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-17 21:28:57 -10:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-08 14:07:19 -04:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-14 16:44:40 +02:00
2026-07-15 12:13:30 +02:00
2026-06-17 11:21:40 -07:00
2026-07-28 12:04:17 +09:00
2026-06-16 08:53:53 -07:00
2026-07-03 07:38:16 +02:00
2026-06-24 06:53:25 -06:00
2026-06-16 13:02:47 +05:30
2026-06-16 10:07:36 -06:00
2026-08-15 23:36:18 +02:00
2026-06-30 16:31:56 +02:00
2026-08-17 10:06:42 +02:00
2026-08-15 11:11:16 -07:00
2026-08-15 11:11:16 -07:00
2026-06-17 12:03:56 +01:00
2026-06-15 13:51:27 +05:30
2026-06-21 11:31:28 -07:00
2026-06-15 14:21:14 +05:30
2026-06-15 14:21:14 +05:30
2026-06-15 05:01:15 +05:30
2026-06-22 12:20:21 -07:00
2026-07-09 15:48:53 -07:00
2026-07-03 07:38:16 +02:00
2026-08-05 17:41:38 -07:00
2026-07-03 07:38:16 +02:00
2026-06-13 13:24:34 -07:00
2026-07-03 07:38:16 +02:00
2026-07-27 18:23:07 -07:00
2026-06-22 19:52:36 +00:00
2026-06-15 03:59:45 +05:30
2026-08-13 04:36:30 +02:00
2026-07-03 07:38:16 +02:00
2026-06-18 16:39:31 -07:00
2026-07-01 19:02:56 -07:00
2026-07-20 10:39:24 -07:00
2026-06-15 02:50:44 +05:30
2026-07-07 10:42:28 -04:00
2026-06-29 23:24:46 +01:00
2026-07-03 07:38:16 +02:00
2026-06-21 11:37:16 -07:00
2026-07-31 16:32:38 +02:00
2026-07-03 07:38:16 +02:00
2026-06-17 00:15:09 +02:00
2026-07-03 07:38:16 +02:00
2026-07-06 14:11:09 +02:00
2026-07-29 17:12:27 -07:00
2026-07-08 14:41:01 +02:00
2026-07-03 07:38:16 +02:00
2026-06-15 02:13:01 +03:00
2026-07-03 07:38:16 +02:00
2026-06-16 09:48:00 -06:00
2026-07-01 15:26:47 +02:00
2026-07-26 13:16:21 -03:00
2026-06-23 12:08:51 -05:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-10 10:42:55 -04:00
2026-06-15 16:33:40 +02:00
2026-06-16 00:39:57 +02:00
2026-06-17 11:28:52 +01:00
2026-07-29 10:52:04 +09:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-27 14:36:26 -07:00
2026-07-03 07:38:16 +02:00
2026-06-19 10:14:34 -07:00
2026-08-04 20:02:00 -07:00
2026-07-03 07:37:43 +02:00
2026-06-11 15:17:30 -07:00
2026-06-15 03:59:45 +05:30
2026-06-12 16:43:10 -07:00
2026-08-06 09:27:21 -07:00
2026-07-28 15:42:31 +02:00
2026-06-23 18:36:41 -07:00
2026-06-26 22:18:34 -04:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-01 19:02:54 -07:00
2026-07-09 15:48:56 -07:00
2026-06-21 11:37:38 -07:00
2026-06-09 17:04:02 -05:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-06-11 13:41:25 +02:00
2026-06-16 08:44:43 +05:30
2026-06-17 09:18:14 +01:00
2026-06-09 10:13:04 -07:00
2026-07-03 07:38:16 +02:00
2026-06-10 11:08:23 +02:00
2026-07-03 07:38:14 +02:00
2026-07-03 07:38:16 +02:00
2026-06-10 00:58:04 +02:00
2026-07-15 05:00:53 -10:00
2026-07-29 17:12:27 -07:00
2026-06-15 03:05:50 +05:30
2026-07-03 07:38:16 +02:00
2026-07-28 15:42:31 +02:00
2026-07-03 07:38:16 +02:00
2026-06-23 00:13:21 +02:00
2026-06-21 13:20:19 -07:00
2026-07-03 07:38:16 +02:00
2026-06-23 12:03:44 -07:00
2026-06-21 13:20:19 -07:00
2026-07-15 11:10:14 +02:00
2026-07-21 11:28:21 +02:00
2026-07-03 07:38:16 +02:00
2026-08-15 23:36:18 +02:00
2026-06-18 16:39:31 -07:00
2026-06-17 09:18:14 +01:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00
2026-07-07 10:42:29 -04:00
2026-06-21 13:20:19 -07:00
2026-07-03 07:38:16 +02:00
2026-06-29 13:46:50 -06:00
2026-07-03 07:38:16 +02:00
2026-06-15 16:33:40 +02:00
2026-07-03 07:38:16 +02:00
2026-07-03 07:38:16 +02:00