syzbot


BUG: sleeping function called from invalid context in __bio_release_pages

Status: upstream: reported on 2025/03/04 07:08
Subsystems: scsi
[Documentation on labels]
Reported-by: syzbot+4b11b8d3d29d2ced1786@syzkaller.appspotmail.com
First crash: 77d, last: 13d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [scsi?] BUG: sleeping function called from invalid context in __bio_release_pages 0 (1) 2025/03/04 07:08

Sample crash report:
BUG: sleeping function called from invalid context at ./include/linux/pagemap.h:1135
in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 5903, name: kworker/1:6
preempt_count: 1, expected: 0
RCU nest depth: 0, expected: 0
3 locks held by kworker/1:6/5903:
 #0: ffff88801b480d48 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x12a2/0x1b70 kernel/workqueue.c:3213
 #1: ffffc900047bfd18 ((work_completion)(&sfp->ew.work)){+.+.}-{0:0}, at: process_one_work+0x929/0x1b70 kernel/workqueue.c:3214
 #2: ffff88807be80080 (&sfp->rq_list_lock){..-.}-{3:3}, at: sg_remove_sfp_usercontext+0x81/0x590 drivers/scsi/sg.c:2210
irq event stamp: 2955830
hardirqs last  enabled at (2955829): [<ffffffff8b6bcb73>] __raw_spin_unlock_irq include/linux/spinlock_api_smp.h:159 [inline]
hardirqs last  enabled at (2955829): [<ffffffff8b6bcb73>] _raw_spin_unlock_irq+0x23/0x50 kernel/locking/spinlock.c:202
hardirqs last disabled at (2955830): [<ffffffff8b6bd012>] __raw_write_lock_irqsave include/linux/rwlock_api_smp.h:184 [inline]
hardirqs last disabled at (2955830): [<ffffffff8b6bd012>] _raw_write_lock_irqsave+0x52/0x60 kernel/locking/spinlock.c:318
softirqs last  enabled at (2955468): [<ffffffff866cb6ed>] spin_unlock_bh include/linux/spinlock.h:396 [inline]
softirqs last  enabled at (2955468): [<ffffffff866cb6ed>] ptr_ring_consume_bh include/linux/ptr_ring.h:367 [inline]
softirqs last  enabled at (2955468): [<ffffffff866cb6ed>] wg_packet_decrypt_worker+0x35d/0x540 drivers/net/wireguard/receive.c:499
softirqs last disabled at (2955466): [<ffffffff866cb63a>] spin_lock_bh include/linux/spinlock.h:356 [inline]
softirqs last disabled at (2955466): [<ffffffff866cb63a>] ptr_ring_consume_bh include/linux/ptr_ring.h:365 [inline]
softirqs last disabled at (2955466): [<ffffffff866cb63a>] wg_packet_decrypt_worker+0x2aa/0x540 drivers/net/wireguard/receive.c:499
Preemption disabled at:
[<0000000000000000>] 0x0
CPU: 1 UID: 0 PID: 5903 Comm: kworker/1:6 Tainted: G     U              6.15.0-rc4-syzkaller-00208-g00b827f0cffa #0 PREEMPT(full) 
Tainted: [U]=USER
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025
Workqueue: events sg_remove_sfp_usercontext
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120
 __might_resched+0x3c0/0x5e0 kernel/sched/core.c:8818
 folio_lock include/linux/pagemap.h:1135 [inline]
 __bio_release_pages+0x312/0x3b0 block/bio.c:1069
 bio_release_pages include/linux/bio.h:441 [inline]
 blk_rq_unmap_user+0x3be/0x980 block/blk-map.c:675
 sg_finish_rem_req+0xde/0x590 drivers/scsi/sg.c:1837
 sg_remove_sfp_usercontext+0x103/0x590 drivers/scsi/sg.c:2213
 process_one_work+0x9cc/0x1b70 kernel/workqueue.c:3238
 process_scheduled_works kernel/workqueue.c:3319 [inline]
 worker_thread+0x6c8/0xf10 kernel/workqueue.c:3400
 kthread+0x3c2/0x780 kernel/kthread.c:464
 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:153
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Crashes (12):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/05/03 10:10 upstream 00b827f0cffa b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/05/03 06:12 upstream 00b827f0cffa b0714e37 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/04/30 12:40 upstream 8bac8898fe39 85a5a23f .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/04/27 11:07 upstream 5bc1018675ec c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/04/26 21:51 upstream f1a3944c860b c6b4fb39 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/04/09 17:54 upstream a24588245776 47d015b1 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/03/26 01:29 upstream 2df0c02dab82 89d30d73 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/03/17 20:33 upstream 4701f33a1070 489e2dc8 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/03/13 13:34 upstream b7f94fcf5546 44be8b44 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/03/09 08:30 upstream b7c90e3e717a 163f510d .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/02/28 06:55 upstream 1e15510b71c9 6a8fcbc4 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
2025/02/28 06:55 upstream 1e15510b71c9 6a8fcbc4 .config console log report info [disk image] [vmlinux] [kernel image] ci-qemu-gce-upstream-auto BUG: sleeping function called from invalid context in __bio_release_pages
* Struck through repros no longer work on HEAD.