[BUG] WARNING in register_fprobe_ips — large kmalloc during fprobe registration (mm/slub.c:5459, v7.4-rc2)
From: 铮
Date: Sun Nov 15 2026 - 05:38:58 EST
Hi Masami,
We found a reproducible warning during BPF kprobe-multi link attachment
on v7.4-rc2 with syzkaller:
The following is an excerpt from the run-3 verification log in the repository,
logs/external-verification/external-verification-serial-run3.log
(selected call-trace frames):
[ 135.891732][T14253] WARNING: mm/slub.c:5459 at
___kmalloc_large_node+0x13f/0x180, CPU#0: syz.4.95/14253
[ 135.909930][T14253] RDX: 00000000ffffffff RSI: 0000000000000dc0
RDI: 0000000002000030
[ 135.912869][T14253] R13: 0000000000100000 R14: dffffc0000000000
R15: 0000000002000030
[ 135.916749][T14253] Call Trace:
[ 135.917020][T14253] <TASK>
[ 135.917261][T14253] __kmalloc_large_node_noprof+0x1f/0x80
[ 135.918112][T14253] __kmalloc_noprof+0x53c/0x7f0
[ 135.918959][T14253] register_fprobe_ips+0x199/0x1df0
[ 135.919866][T14253] bpf_kprobe_multi_link_attach+0xf50/0x13f0
[ 135.923516][T14253] __sys_bpf+0x4a20/0x4ef0
[ 135.931744][T14253] __x64_sys_bpf+0xd0/0x140
[ 135.932506][T14253] do_syscall_64+0x132/0x7c0
[ 135.932870][T14253] entry_SYSCALL_64_after_hwframe+0x77/0x7f
[ 135.939128][T14253] Kernel panic - not syncing: kernel:
panic_on_warn set ...
The triggering program uses bpf$BPF_LINK_CREATE_XDP with the @kprobe_multi
branch, specifying cnt = 0x100000 (1,048,576) — exactly MAX_KPROBE_MULTI_CNT
(1U << 20, kernel/trace/bpf_trace.c:45). The count passes the existing
limit check and proceeds to register_fprobe_ips(), which calls
kzalloc_flex(*hlist_array, array, num) (kernel/trace/fprobe.c:918) with
num = 0x100000. The resulting ~32 MiB kzalloc triggers the SLUB size
check WARNING. Our guest runs with panic_on_warn=1, which escalates this
warning to a kernel panic.
A question for maintainers: should the BPF count limit also account for
the actual memory footprint of the fprobe internal array, or is the SLUB
warning expected for this allocation size?
Kernel/config: 7.4.0-rc2-kernsight-kasan #1, built from v7.4-rc2 with
CONFIG_KASAN=y, booted with oops=panic and panic_on_warn=1.
How to reproduce
----------------
The crash depends on kernel state built up by preceding operations. The
reproducer is an ordered set of 84 programs; the triggering kprobe-multi
operation is program 78 (0-based).
1. Boot a fresh Debian trixie x86_64 VM (6 GiB RAM, 4 vCPU, KVM) with the
v7.4-rc2 kernel image described above (bzImage sha256
e47d1c181af5f2615519de03ffc7bf73dad36b8ffb84b86e50391ed53bb731d6) and the
QEMU command line in environment.txt.
2. Copy syz-execprog and syz-executor (syzkaller commit
853b104bb454141a5b0fc0e4218ec78e9f34ffb1) and
reproducer/repro.kernsight.prog into the guest.
3. In the guest, as root, run:
syz-execprog -procs=8 -threaded -repeat=1 -executor ./syz-executor
repro.kernsight.prog
The programs are replayed with 8 parallel workers (-repeat=1); runs 1-2 used
chunked single-pass replay of the same 84-program set. The warning appears
about 2-13 minutes after boot. It was reproduced 3/3 times on fresh VMs, at
384.3 s, 774.4 s and 135.9 s after boot for runs 1-3, respectively. The three
full consoles are in logs/external-verification/.
Related upstream work:
We checked the earlier BPF fix:
https://github.com/torvalds/linux/commit/d6d1e6c17cab2dcb7b8530c599f00e7de906d380
The fix introduced MAX_KPROBE_MULTI_CNT (1U << 20) and rejects larger
kprobe-multi counts with -E2BIG. We verified that both the limit and
the corresponding check are present in our clean v7.4-rc2 source tree.
However, the reproducer uses cnt = 0x100000, which is exactly the
permitted maximum. The warning is reached later through
bpf_kprobe_multi_link_attach() and register_fprobe_ips(), when
fprobe_init() attempts to allocate its internal array using
kzalloc_flex().
The crash log shows an allocation request of 0x2000030 bytes (32 MiB +
48 bytes).
The earlier limit was sized for the `cnt * sizeof(*addrs)` array (8 MiB at the
maximum); `struct fprobe_hlist_node` is 32 bytes, so the same permitted count
also drives a 32 MiB allocation, above the 4 MiB KMALLOC_MAX_SIZE of this
configuration.
We also noticed the following SLUB patch discussion:
https://lists.openwall.net/linux-kernel/2026/08/31/138
This describes an explicit KMALLOC_MAX_SIZE check that warns and
returns NULL for unsupported allocation sizes.
Our report therefore concerns an oversized allocation request reaching
this check from the BPF/fprobe registration path, despite the existing
kprobe-multi count limit.
We have not established whether an additional count limit, a different
allocation strategy, or warning suppression would be the preferred
fix.
A full write-up, the reproducer and the crash artifacts are available at:
https://github.com/Zheng-zheng-codes/fprobe-registration-kmalloc-warning
Repository contents:
- README.md full bug report: phenomenon, stack trace,
mechanism, verified reproduction runs
- reproducer/repro.kernsight.prog
pipeline-verified reproducer (84-program
ordered set)
- reproducer/repro.prog single-program reproducer generated by the
original fuzzing pipeline; does not
independently reproduce this warning
- reproducer/repro.priming.prog state-priming program set (pipeline recipe)
- kernel.config kernel configuration used
- environment.txt kernel image info (sha256), QEMU command
line, syzkaller commit, reproducer command
- logs/log-0.txt, logs/report-0.txt
original syzkaller execution log and crash
report from the fuzzing pipeline
- logs/machineInfo-*.txt, logs/title-stat.json
guest environment info and title statistics
- logs/external-verification/ external verification artifacts
(serial consoles of 3 verified runs)
Happy to provide the kernel image, additional crash instances or raw
artifacts if useful.
Best regards,
Zheng Zheng