[v5.15] BUG: sleeping function called from invalid context in bpf_test_timer_continue

2 views
Skip to first unread message

syzbot

unread,
Feb 5, 2024, 10:42:25 AMFeb 5
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 6139f2a02fe0 Linux 5.15.148
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=176abfffe80000
kernel config: https://syzkaller.appspot.com/x/.config?x=c170eb20d8be8542
dashboard link: https://syzkaller.appspot.com/bug?extid=4155f6d497406cac5053
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=15d4dbffe80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=125cfd18180000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2ac68f24aed3/disk-6139f2a0.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e8982a3768c5/vmlinux-6139f2a0.xz
kernel image: https://storage.googleapis.com/syzbot-assets/eb272dd019ce/bzImage-6139f2a0.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+4155f6...@syzkaller.appspotmail.com

BUG: sleeping function called from invalid context at net/bpf/test_run.c:77
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 3717, name: syz-executor318
no locks held by syz-executor318/3717.
Preemption disabled at:
[<ffffffff81964784>] try_get_fmt_tmp_buf kernel/bpf/helpers.c:728 [inline]
[<ffffffff81964784>] bpf_bprintf_prepare+0x114/0x1310 kernel/bpf/helpers.c:778
CPU: 1 PID: 3717 Comm: syz-executor318 Not tainted 5.15.148-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_sleep+0x547/0x6a0 kernel/sched/core.c:9626
bpf_test_timer_continue+0x26f/0x350 net/bpf/test_run.c:77
bpf_test_run+0x42b/0x8a0 net/bpf/test_run.c:120
bpf_prog_test_run_skb+0xb41/0x1420 net/bpf/test_run.c:663
bpf_prog_test_run+0x32f/0x3a0 kernel/bpf/syscall.c:3340
__sys_bpf+0x3ac/0x670 kernel/bpf/syscall.c:4641
__do_sys_bpf kernel/bpf/syscall.c:4727 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4725 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4725
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7fac9be3b229
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:00007ffc9b112f98 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fac9be3b229
RDX: 000000000000004c 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-executor318/3717/0x00000002
no locks held by syz-executor318/3717.
Modules linked in:
Preemption disabled at:
[<ffffffff81964784>] try_get_fmt_tmp_buf kernel/bpf/helpers.c:728 [inline]
[<ffffffff81964784>] bpf_bprintf_prepare+0x114/0x1310 kernel/bpf/helpers.c:778


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Mar 1, 2024, 12:40:06 AMMar 1
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit f19a4050455aad847fb93f18dc1fe502eb60f989
git tree: upstream
Author: Jiri Olsa <jo...@kernel.org>
Date: Thu Dec 15 21:44:29 2022 +0000

bpf: Do cleanup in bpf_bprintf_cleanup only when needed

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=153ff3ba180000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12ce8f38180000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1134dbffe80000


Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Mar 1, 2024, 11:34:05 AMMar 1
to syzkaller...@googlegroups.com
The commit that was suspected to fix the issue was backported to the fuzzed
kernel trees.

commit 4b349c55bbd33c8918dbac13876d6842af571505
Author: <jo...@kernel.org>
Date: Sat Feb 17 12:13:20 2024 +0000

bpf: Do cleanup in bpf_bprintf_cleanup only when needed

If you believe this is correct, please reply with
#syz fix: bpf: Do cleanup in bpf_bprintf_cleanup only when needed

The commit was initially detected here:

commit f19a4050455aad847fb93f18dc1fe502eb60f989
git tree: upstream
Author: Jiri Olsa <jo...@kernel.org>
Date: Thu Dec 15 21:44:29 2022 +0000

bpf: Do cleanup in bpf_bprintf_cleanup only when needed

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=153ff3ba180000
Reply all
Reply to author
Forward
0 new messages