Files
linux/kernel/bpf
Deepanshu Kartikey 9df5fad801 bpf: Reject BPF_MAP_TYPE_INSN_ARRAY in check_reg_const_str()
BPF_MAP_TYPE_INSN_ARRAY maps store instruction pointers in their
ips array, not string data. The map_direct_value_addr callback for
this map type returns the address of the ips array, which is not
suitable for use as a constant string argument.

When a BPF program passes a pointer to an insn_array map value as
ARG_PTR_TO_CONST_STR (e.g., to bpf_snprintf), the verifier's
null-termination check in check_reg_const_str() operates on the
wrong memory region, and at runtime bpf_bprintf_prepare() can read
out of bounds searching for a null terminator.

Reject BPF_MAP_TYPE_INSN_ARRAY in check_reg_const_str() since this
map type is not designed to hold string data.

Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=2c29addf92581b410079
Tested-by: [email protected]
Fixes: 493d9e0d60 ("bpf, x86: add support for indirect jumps")
Signed-off-by: Deepanshu Kartikey <[email protected]>
Acked-by: Anton Protopopov <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
2026-01-07 19:03:46 -08:00
..
2024-08-30 08:55:26 -07:00
2024-08-30 08:55:26 -07:00
2025-12-09 23:29:42 -08:00
2025-08-12 14:56:04 -07:00
…
2025-11-16 01:35:03 -05:00
2025-11-05 17:53:23 -08:00
…
2024-08-30 08:55:26 -07:00
2024-08-30 08:57:47 -07:00
2025-07-11 11:00:57 -07:00