possible deadlock in blkdev_put

Status: upstream: reported on 2026/07/12 08:46
Reported-by: syzbot+f3ec913e8a06b0a45134@syzkaller.appspotmail.com
First crash: 72d, last: 4d23h
Similar bugs (9)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream possible deadlock in blkdev_put (4) block 4 2 1058d 1072d 0/29 auto-obsoleted due to no activity on 2024/02/07 19:21
linux-4.19 possible deadlock in blkdev_put btrfs 4 syz, C error 2 1330d 1360d 0/1 upstream: reported C repro on 2023/01/01 16:48
upstream possible deadlock in blkdev_put btrfs 4 1 2193d 2192d 0/29 auto-closed as invalid on 2021/01/18 22:03
upstream possible deadlock in blkdev_put (3) block exfat 4 syz, C 870 1582d 1655d 22/29 fixed on 2023/02/24 13:50
upstream possible deadlock in blkdev_put (2) exfat block 4 syz, C done 502 1659d 1760d 20/29 fixed on 2022/03/08 16:11
linux-5.15 possible deadlock in blkdev_put 4 1 9d17h 9d17h 0/3 upstream: reported on 2026/09/13 04:41
linux-6.6 possible deadlock in blkdev_put (2) 4 5 134d 162d 0/2 auto-obsoleted due to no activity on 2026/08/19 22:08
linux-6.6 possible deadlock in blkdev_put 4 4 267d 369d 0/2 auto-obsoleted due to no activity on 2026/04/08 12:30
linux-4.14 possible deadlock in blkdev_put 4 syz, C 5 1311d 2182d 0/1 upstream: reported C repro on 2020/10/01 09:27

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.197/4954 is trying to acquire lock:
ffff88802dace9b8 ((work_completion)(&head->partition_scan_work)){+.+.}-{0:0}, at: __flush_work+0x109/0xac0 kernel/workqueue.c:3072

but task is already holding lock:
ffff888029c1f4c8
 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xf7/0x780 block/bdev.c:926

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #1 (&disk->open_mutex){+.+.}-{3:3}:
       __mutex_lock_common kernel/locking/mutex.c:603 [inline]
       __mutex_lock+0x12d/0xae0 kernel/locking/mutex.c:747
       nvme_partition_scan_work+0x93/0xe0 drivers/nvme/host/multipath.c:481
       process_one_work+0x8ab/0x1160 kernel/workqueue.c:2292
       worker_thread+0xaf5/0x12a0 kernel/workqueue.c:2439
       kthread+0x29d/0x330 kernel/kthread.c:376
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295

-> #0 ((work_completion)(&head->partition_scan_work)){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3095 [inline]
       check_prevs_add kernel/locking/lockdep.c:3214 [inline]
       validate_chain kernel/locking/lockdep.c:3830 [inline]
       __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063
       lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5678
       __flush_work+0x122/0xac0 kernel/workqueue.c:3072
       nvme_mpath_remove_disk+0x6a/0xa0 drivers/nvme/host/multipath.c:903
       nvme_free_ns_head drivers/nvme/host/core.c:625 [inline]
       kref_put include/linux/kref.h:65 [inline]
       nvme_put_ns_head+0x5f/0x140 drivers/nvme/host/core.c:639
       blkdev_put+0x5b4/0x780 block/bdev.c:-1
       blkdev_close+0x51/0x80 block/fops.c:514
       __fput+0x20a/0x8b0 fs/file_table.c:320
       task_work_run+0x1d0/0x260 kernel/task_work.c:203
       resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
       exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180
       exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213
       __syscall_exit_to_user_mode_work kernel/entry/common.c:295 [inline]
       syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:306
       do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
       entry_SYSCALL_64_after_hwframe+0x68/0xd2

other info that might help us debug this:

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&disk->open_mutex);
                               lock((work_completion)(&head->partition_scan_work));
                               lock(&disk->open_mutex);
  lock((work_completion)(&head->partition_scan_work));

 *** DEADLOCK ***

1 lock held by syz.4.197/4954:
 #0: ffff888029c1f4c8 (&disk->open_mutex){+.+.}-{3:3}, at: blkdev_put+0xf7/0x780 block/bdev.c:926

stack backtrace:
CPU: 1 PID: 4954 Comm: syz.4.197 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/24/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106
 check_noncircular+0x296/0x330 kernel/locking/lockdep.c:2170
 check_prev_add kernel/locking/lockdep.c:3095 [inline]
 check_prevs_add kernel/locking/lockdep.c:3214 [inline]
 validate_chain kernel/locking/lockdep.c:3830 [inline]
 __lock_acquire+0x2d18/0x7c40 kernel/locking/lockdep.c:5063
 lock_acquire+0x1bb/0x4a0 kernel/locking/lockdep.c:5678
 __flush_work+0x122/0xac0 kernel/workqueue.c:3072
 nvme_mpath_remove_disk+0x6a/0xa0 drivers/nvme/host/multipath.c:903
 nvme_free_ns_head drivers/nvme/host/core.c:625 [inline]
 kref_put include/linux/kref.h:65 [inline]
 nvme_put_ns_head+0x5f/0x140 drivers/nvme/host/core.c:639
 blkdev_put+0x5b4/0x780 block/bdev.c:-1
 blkdev_close+0x51/0x80 block/fops.c:514
 __fput+0x20a/0x8b0 fs/file_table.c:320
 task_work_run+0x1d0/0x260 kernel/task_work.c:203
 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline]
 exit_to_user_mode_loop+0xe6/0x110 kernel/entry/common.c:180
 exit_to_user_mode_prepare+0xee/0x180 kernel/entry/common.c:213
 __syscall_exit_to_user_mode_work kernel/entry/common.c:295 [inline]
 syscall_exit_to_user_mode+0x16/0x40 kernel/entry/common.c:306
 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:82
 entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fa76e59e159
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdd3a6ec58 EFLAGS: 00000246 ORIG_RAX: 00000000000001b4
RAX: 0000000000000000 RBX: 00007fa76e827da0 RCX: 00007fa76e59e159
RDX: 0000000000000000 RSI: 000000000000001e RDI: 0000000000000003
RBP: 00007fa76e827da0 R08: 0000000000000006 R09: 0000000000000000
R10: 00007fa76e827cb0 R11: 0000000000000246 R12: 000000000001c687
R13: 00007fa76e82609c R14: 000000000001c3de R15: 00007fa76e826090
 </TASK>

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/09/17 23:25 linux-6.1.y 1a8763b93150 8d7d05f1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in blkdev_put
2026/09/17 23:24 linux-6.1.y 1a8763b93150 8d7d05f1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in blkdev_put
2026/09/17 23:23 linux-6.1.y 1a8763b93150 8d7d05f1 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in blkdev_put
2026/07/12 08:45 linux-6.1.y 090666d3cc90 d78ea535 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan possible deadlock in blkdev_put
* Struck through repros no longer work on HEAD.