syzbot


WARNING in bpf_bprintf_prepare (3)

Status: upstream: reported C repro on 2025/10/20 21:08
Subsystems: bpf
[Documentation on labels]
Reported-by: syzbot+b0cff308140f79a9c4cb@syzkaller.appspotmail.com
Fix commit: bpf: Prevent nesting overflow in bpf_try_get_buffers
Patched on: [ci-upstream-bpf-next-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci-upstream-rust-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 27d, last: 1d03h
Cause bisection: introduced by (bisect log) :
commit 7c33e97a6ef5d84e98b892c3e00c6d1678d20395
Author: Sahil Chandna <chandna.sahil@gmail.com>
Date: Tue Oct 14 18:56:35 2025 +0000

  bpf: Do not disable preemption in bpf_test_run().

Crash: WARNING in bpf_bprintf_prepare (log)
Repro: C syz .config
  
Discussions (5)
Title Replies (including bot) Last reply
[PATCH bpf-next v3] bpf: prevent nesting overflow in bpf_try_get_buffers 2 (2) 2025/11/14 21:10
[PATCH bpf-next v2] bpf: use preempt_disable/enable() to protect bpf_bprintf_buffers nesting 4 (4) 2025/11/14 21:10
Re: [PATCH bpf-next] bpf: use preempt_disable/enable() to protect bpf_bprintf_buffers nesting 1 (1) 2025/11/11 10:37
[PATCH bpf-next] bpf: use preempt_disable/enable() to protect bpf_bprintf_buffers nesting 1 (1) 2025/11/09 17:36
[syzbot] [bpf?] WARNING in bpf_bprintf_prepare (3) 13 (18) 2025/11/03 04:39
Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING in bpf_bprintf_prepare (2) bpf -1 C 2 1128d 1167d 22/29 fixed on 2023/02/24 13:50
upstream WARNING in bpf_bprintf_prepare bpf -1 C unreliable 96 1611d 1649d 20/29 fixed on 2021/11/10 00:50
Last patch testing requests (4)
Created Duration User Patch Repo Result
2025/10/21 16:26 1h27m chandna.sahil@gmail.com patch bpf OK log
2025/10/21 09:56 2h39m listout@listout.xyz patch bpf report log
2025/10/21 09:53 1h38m listout@listout.xyz patch bpf report log
2025/10/21 06:49 13m chandna.sahil@gmail.com patch bpf error

Sample crash report:
------------[ cut here ]------------
WARNING: CPU: 0 PID: 6164 at kernel/bpf/helpers.c:781 bpf_try_get_buffers kernel/bpf/helpers.c:781 [inline]
WARNING: CPU: 0 PID: 6164 at kernel/bpf/helpers.c:781 bpf_bprintf_prepare+0x12cf/0x13a0 kernel/bpf/helpers.c:834
Modules linked in:
CPU: 0 UID: 0 PID: 6164 Comm: syz.1.101 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
RIP: 0010:bpf_try_get_buffers kernel/bpf/helpers.c:781 [inline]
RIP: 0010:bpf_bprintf_prepare+0x12cf/0x13a0 kernel/bpf/helpers.c:834
Code: ff e9 ce fe ff ff e8 10 ec e0 ff e9 be fe ff ff e8 06 ec e0 ff e9 b4 fe ff ff e8 fc eb e0 ff e9 aa fe ff ff e8 f2 eb e0 ff 90 <0f> 0b 90 65 ff 0d 17 1d 90 10 b8 f0 ff ff ff e9 17 ff ff ff e8 d8
RSP: 0018:ffffc900033c7840 EFLAGS: 00010293
RAX: ffffffff81df180e RBX: ffffc900033c7a10 RCX: ffff88801b305ac0
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000003
RBP: ffffc900033c7970 R08: 0000000000585870 R09: 0000000000000005
R10: dffffc0000000000 R11: fffff52000678f20 R12: dffffc0000000000
R13: 0000000000000004 R14: 0000000000000003 R15: 1ffff92000678f42
FS:  000055558912d500(0000) GS:ffff88812613e000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000000 CR3: 000000007fcf0000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 ____bpf_trace_printk kernel/trace/bpf_trace.c:372 [inline]
 bpf_trace_printk+0xdb/0x190 kernel/trace/bpf_trace.c:362
 bpf_prog_70ade08689effdc9+0x41/0x4c
 bpf_dispatcher_nop_func include/linux/bpf.h:1350 [inline]
 __bpf_prog_run include/linux/filter.h:721 [inline]
 bpf_prog_run include/linux/filter.h:728 [inline]
 bpf_prog_run_pin_on_cpu include/linux/filter.h:745 [inline]
 bpf_flow_dissect+0x225/0x720 net/core/flow_dissector.c:1024
 bpf_prog_test_run_flow_dissector+0x37c/0x5c0 net/bpf/test_run.c:1414
 bpf_prog_test_run+0x2c7/0x340 kernel/bpf/syscall.c:4688
 __sys_bpf+0x562/0x860 kernel/bpf/syscall.c:6167
 __do_sys_bpf kernel/bpf/syscall.c:6259 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:6257 [inline]
 __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:6257
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f215ef8efc9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc51384ea8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f215f1e5fa0 RCX: 00007f215ef8efc9
RDX: 0000000000000050 RSI: 0000200000000180 RDI: 000000000000000a
RBP: 00007f215f011f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f215f1e5fa0 R14: 00007f215f1e5fa0 R15: 0000000000000003
 </TASK>

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/30 05:10 bpf 2cbb259ec4f8 fd2207e7 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_bprintf_prepare
2025/10/18 08:04 bpf a1e83d4c0361 1c8c8cd8 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_bprintf_prepare
2025/11/09 07:03 bpf-next f8c67d8550ee 4e1406b4 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_bprintf_prepare
2025/10/29 01:41 bpf-next 9f317bdbc21a fd2207e7 .config console log report syz / log C [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_bprintf_prepare
2025/11/14 03:37 bpf 91a78ce994e7 07e030de .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-kasan-gce WARNING in bpf_bprintf_prepare
2025/11/06 13:24 bpf-next b54a8e130c02 a6c9c731 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-bpf-next-kasan-gce WARNING in bpf_bprintf_prepare
* Struck through repros no longer work on HEAD.