syzbot


BUG: sleeping function called from invalid context in bpf_test_timer_continue

Status: upstream: reported C repro on 2024/01/09 18:30
Bug presence: origin:lts-only
[Documentation on labels]
Reported-by: syzbot+29384a0e217e29680d72@syzkaller.appspotmail.com
First crash: 347d, last: 316d
Fix commit to backport (bisect log) :
tree: upstream
commit f19a4050455aad847fb93f18dc1fe502eb60f989
Author: Jiri Olsa <jolsa@kernel.org>
Date: Thu Dec 15 21:44:29 2022 +0000

  bpf: Do cleanup in bpf_bprintf_cleanup only when needed

  
Bug presence (2)
Date Name Commit Repro Result
2024/02/07 linux-6.1.y (ToT) f1bb70486c9c C [report] INFO: rcu detected stall in corrupted
2024/02/07 upstream (ToT) 99bd3cb0d12e C Didn't crash
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 BUG: sleeping function called from invalid context in bpf_test_timer_continue origin:lts-only C done 5 317d 319d 0/3 upstream: reported C repro on 2024/02/05 15:42
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2024/02/25 00:10 5h38m fix candidate upstream OK (1) job log

Sample crash report:
BUG: sleeping function called from invalid context at net/bpf/test_run.c:81
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3557, name: syz-executor229
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
no locks held by syz-executor229/3557.
Preemption disabled at:
[<ffffffff81a228d4>] try_get_fmt_tmp_buf kernel/bpf/helpers.c:771 [inline]
[<ffffffff81a228d4>] bpf_bprintf_prepare+0x114/0x1310 kernel/bpf/helpers.c:821
CPU: 0 PID: 3557 Comm: syz-executor229 Not tainted 6.1.77-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106
 __might_resched+0x5cb/0x780 kernel/sched/core.c:9942
 bpf_test_timer_continue+0x26f/0x350 net/bpf/test_run.c:81
 bpf_test_run+0x44b/0x8b0 net/bpf/test_run.c:403
 bpf_prog_test_run_skb+0xaf1/0x13a0 net/bpf/test_run.c:1180
 bpf_prog_test_run+0x32f/0x3a0 kernel/bpf/syscall.c:3670
 __sys_bpf+0x3eb/0x6c0 kernel/bpf/syscall.c:5023
 __do_sys_bpf kernel/bpf/syscall.c:5109 [inline]
 __se_sys_bpf kernel/bpf/syscall.c:5107 [inline]
 __x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:5107
 do_syscall_x64 arch/x86/entry/common.c:51 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f7b3d6c3229
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 c1 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd814fffb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f7b3d6c3229
RDX: 0000000000000050 RSI: 0000000020000640 RDI: 000000000000000a
RBP: 0000000000000000 R08: 00000000000000a0 R09: 00000000000000a0
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
 </TASK>
BUG: scheduling while atomic: syz-executor229/3557/0x00000002
no locks held by syz-executor229/3557.
Modules linked in:
Preemption disabled at:
[<ffffffff81a228d4>] try_get_fmt_tmp_buf kernel/bpf/helpers.c:771 [inline]
[<ffffffff81a228d4>] bpf_bprintf_prepare+0x114/0x1310 kernel/bpf/helpers.c:821

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/02/09 02:39 linux-6.1.y f1bb70486c9c 7f07e9b0 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf BUG: sleeping function called from invalid context in bpf_test_timer_continue
2024/02/07 02:08 linux-6.1.y f1bb70486c9c 6404acf9 .config console log report syz C [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf BUG: sleeping function called from invalid context in bpf_test_timer_continue
2024/01/09 12:24 linux-6.1.y 38fb82ecd144 4807fb37 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-perf BUG: sleeping function called from invalid context in bpf_test_timer_continue
* Struck through repros no longer work on HEAD.