possible deadlock in raid_dtr

Status: upstream: reported on 2026/11/12 21:10
Reported-by: syzbot+529c3c85c2ae271e2ed2@syzkaller.appspotmail.com
First crash: 16h00m, last: 16h00m
▶ ▼ Similar bugs (2)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.1 possible deadlock in raid_dtr 4 1 3d03h 3d03h 0/3 upstream: reported on 2026/11/10 09:22
linux-6.6 possible deadlock in raid_dtr 4 1 7d09h 7d09h 0/2 upstream: reported on 2026/11/06 03:26

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
syz.4.831/7535 is trying to acquire lock:
ffff888141bbb938 ((wq_completion)md_misc){+.+.}-{0:0}, at: flush_workqueue+0x14e/0x1390 kernel/workqueue.c:2830

but task is already holding lock:
ffff88802d304318 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: mddev_lock_nointr drivers/md/md.h:551 [inline]
ffff88802d304318 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: raid_dtr+0x43/0x60 drivers/md/dm-raid.c:3322

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 (&mddev->reconfig_mutex){+.+.}-{3:3}:
       __mutex_lock_common+0x1e5/0x2400 kernel/locking/mutex.c:596
       __mutex_lock kernel/locking/mutex.c:729 [inline]
       mutex_lock_interruptible_nested+0x17/0x20 kernel/locking/mutex.c:765
       mddev_lock drivers/md/md.h:543 [inline]
       array_state_store+0x2e4/0x9c0 drivers/md/md.c:4510
       md_attr_store+0xdd/0x130 drivers/md/md.c:5643
       kernfs_fop_write_iter+0x3a8/0x500 fs/kernfs/file.c:296
       call_write_iter include/linux/fs.h:2179 [inline]
       new_sync_write fs/read_write.c:507 [inline]
       vfs_write+0x748/0xd70 fs/read_write.c:594
       ksys_write+0x153/0x260 fs/read_write.c:647
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

-> #2 (kn->active#616){++++}-{0:0}:
       kernfs_drain fs/kernfs/dir.c:478 [inline]
       __kernfs_remove+0x5da/0xcb0 fs/kernfs/dir.c:1372
       kernfs_remove+0x1d/0x30 fs/kernfs/dir.c:1406
       __kobject_del+0xe0/0x2e0 lib/kobject.c:628
       kobject_del+0x41/0x60 lib/kobject.c:651
       mddev_delayed_delete+0x27/0x30 drivers/md/md.c:5686
       process_one_work+0x867/0xff0 kernel/workqueue.c:2310
       worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
       kthread+0x42e/0x520 kernel/kthread.c:334
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #1 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}:
       process_one_work+0x7ba/0xff0 kernel/workqueue.c:2286
       worker_thread+0xad7/0x12a0 kernel/workqueue.c:2457
       kthread+0x42e/0x520 kernel/kthread.c:334
       ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287

-> #0 ((wq_completion)md_misc){+.+.}-{0:0}:
       check_prev_add kernel/locking/lockdep.c:3120 [inline]
       check_prevs_add kernel/locking/lockdep.c:3239 [inline]
       validate_chain kernel/locking/lockdep.c:3855 [inline]
       __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120
       lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737
       flush_workqueue+0x16a/0x1390 kernel/workqueue.c:2830
       __md_stop+0x190/0x2f0 drivers/md/md.c:6351
       md_stop+0x7a/0xe0 drivers/md/md.c:6371
       raid_dtr+0x4b/0x60 drivers/md/dm-raid.c:3323
       dm_table_destroy+0x185/0x420 drivers/md/dm-table.c:195
       table_load+0x5e6/0x760 drivers/md/dm-ioctl.c:1527
       ctl_ioctl drivers/md/dm-ioctl.c:2032 [inline]
       dm_ctl_ioctl+0x947/0xd00 drivers/md/dm-ioctl.c:2054
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:874 [inline]
       __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
       do_syscall_x64 arch/x86/entry/common.c:50 [inline]
       do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
       entry_SYSCALL_64_after_hwframe+0x66/0xd0

other info that might help us debug this:

Chain exists of:
  (wq_completion)md_misc --> kn->active#616 --> &mddev->reconfig_mutex

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock(&mddev->reconfig_mutex);
                               lock(kn->active#616);
                               lock(&mddev->reconfig_mutex);
  lock((wq_completion)md_misc);

 *** DEADLOCK ***

1 lock held by syz.4.831/7535:
 #0: ffff88802d304318 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: mddev_lock_nointr drivers/md/md.h:551 [inline]
 #0: ffff88802d304318 (&mddev->reconfig_mutex){+.+.}-{3:3}, at: raid_dtr+0x43/0x60 drivers/md/dm-raid.c:3322

stack backtrace:
CPU: 1 PID: 7535 Comm: syz.4.831 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
Call Trace:
 <TASK>
 dump_stack_lvl+0x188/0x250 lib/dump_stack.c:106
 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2178
 check_prev_add kernel/locking/lockdep.c:3120 [inline]
 check_prevs_add kernel/locking/lockdep.c:3239 [inline]
 validate_chain kernel/locking/lockdep.c:3855 [inline]
 __lock_acquire+0x38f7/0x7d40 kernel/locking/lockdep.c:5120
 lock_acquire+0x19f/0x400 kernel/locking/lockdep.c:5737
 flush_workqueue+0x16a/0x1390 kernel/workqueue.c:2830
 __md_stop+0x190/0x2f0 drivers/md/md.c:6351
 md_stop+0x7a/0xe0 drivers/md/md.c:6371
 raid_dtr+0x4b/0x60 drivers/md/dm-raid.c:3323
 dm_table_destroy+0x185/0x420 drivers/md/dm-table.c:195
 table_load+0x5e6/0x760 drivers/md/dm-ioctl.c:1527
 ctl_ioctl drivers/md/dm-ioctl.c:2032 [inline]
 dm_ctl_ioctl+0x947/0xd00 drivers/md/dm-ioctl.c:2054
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:874 [inline]
 __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:860
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7fd6d7dbf4d9
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:00007fd6d5feb028 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fd6d803c090 RCX: 00007fd6d7dbf4d9
RDX: 00002000000002c0 RSI: 00000000c138fd09 RDI: 0000000000000003
RBP: 00007fd6d7e4e04e R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd6d803c128 R14: 00007fd6d803c090 R15: 00007ffe7a5a8138
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/11/12 21:09 linux-5.15.y 29c6cdaac04a c0087d7f .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan possible deadlock in raid_dtr
* Struck through repros no longer work on HEAD.