possible deadlock in md_start_sync

Status: upstream: reported on 2026/08/02 00:00
Subsystems: raid
Labels: prio:low
[Documentation on labels]
Reported-by: syzbot+13eb8132f7693fe21d7d@syzkaller.appspotmail.com
First crash: 7d00h, last: 2d13h
✨ AI Jobs (1)
ID Workflow Result Correct Bug Created Started Finished Revision Error
8f03291e assessment-security DenialOfService: ✅ Exploitable: ❌ FilesystemTrigger: ❌ NetworkTrigger: ❌ PeripheralTrigger: ❌ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ possible deadlock in md_start_sync 2026/07/29 03:12 2026/07/29 03:12 2026/07/29 03:21 7be3c40b

			
		
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [raid?] possible deadlock in md_start_sync 0 (1) 2026/08/02 00:00

Sample crash report:
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Tainted: G             L     
------------------------------------------------------
kworker/0:7/5865 is trying to acquire lock:
ffff88805a656358 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: mddev_lock_nointr drivers/md/md.h:735 [inline]
ffff88805a656358 (&mddev->reconfig_mutex){+.+.}-{4:4}, at: md_start_sync+0x79/0xbe0 drivers/md/md.c:10190

but task is already holding lock:
ffffc900044bfd08 ((work_completion)(&mddev->sync_work)){+.+.}-{0:0}, at: process_one_work+0x988/0x1940 kernel/workqueue.c:3298

which lock already depends on the new lock.


the existing dependency chain (in reverse order) is:

-> #3 ((work_completion)(&mddev->sync_work)){+.+.}-{0:0}:
       lock_acquire kernel/locking/lockdep.c:5868 [inline]
       lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
       process_one_work+0x98e/0x1940 kernel/workqueue.c:3298
       process_scheduled_works kernel/workqueue.c:3405 [inline]
       worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486
       kthread+0x370/0x450 kernel/kthread.c:436
       ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

-> #2 ((wq_completion)md_misc){+.+.}-{0:0}:
       lock_acquire kernel/locking/lockdep.c:5868 [inline]
       lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
       touch_wq_lockdep_map+0xad/0x1c0 kernel/workqueue.c:4037
       __flush_workqueue+0x131/0x1200 kernel/workqueue.c:4079
       md_alloc+0x30/0x10a0 drivers/md/md.c:6313
       md_alloc_and_put drivers/md/md.c:6402 [inline]
       md_probe drivers/md/md.c:6418 [inline]
       md_probe+0x73/0xf0 drivers/md/md.c:6413
       blk_probe_dev+0x149/0x1e0 block/genhd.c:880
       blk_request_module+0x16/0xc0 block/genhd.c:893
       blkdev_get_no_open+0x9b/0xf0 block/bdev.c:828
       blkdev_open+0x141/0x4f0 block/fops.c:663
       do_dentry_open+0x6ab/0x14d0 fs/open.c:947
       vfs_open+0x82/0x3f0 fs/open.c:1052
       do_open fs/namei.c:4700 [inline]
       path_openat+0x2873/0x4280 fs/namei.c:4863
       do_file_open+0x20e/0x430 fs/namei.c:4892
       do_sys_openat2+0x10f/0x1e0 fs/open.c:1368
       do_sys_open fs/open.c:1374 [inline]
       __do_sys_openat fs/open.c:1390 [inline]
       __se_sys_openat fs/open.c:1385 [inline]
       __x64_sys_openat+0x12d/0x210 fs/open.c:1385
       do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
       do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #1 (major_names_lock){+.+.}-{4:4}:
       lock_acquire kernel/locking/lockdep.c:5868 [inline]
       lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
       __mutex_lock_common kernel/locking/mutex.c:646 [inline]
       __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821
       blk_probe_dev+0x28/0x1e0 block/genhd.c:877
       blk_request_module+0x16/0xc0 block/genhd.c:893
       blkdev_get_no_open+0x9b/0xf0 block/bdev.c:828
       bdev_file_open_by_dev block/bdev.c:1049 [inline]
       bdev_file_open_by_dev+0x70/0x210 block/bdev.c:1037
       md_import_device+0x120/0x360 drivers/md/md.c:3845
       md_add_new_disk+0xdbf/0x1820 drivers/md/md.c:7637
       md_ioctl+0x2b28/0x36b0 drivers/md/md.c:8476
       blkdev_ioctl+0x5ad/0x6f0 block/ioctl.c:797
       vfs_ioctl fs/ioctl.c:51 [inline]
       __do_sys_ioctl fs/ioctl.c:597 [inline]
       __se_sys_ioctl fs/ioctl.c:583 [inline]
       __x64_sys_ioctl+0x18e/0x210 fs/ioctl.c:583
       do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
       do_syscall_64+0x115/0x870 arch/x86/entry/syscall_64.c:94
       entry_SYSCALL_64_after_hwframe+0x77/0x7f

-> #0 (&mddev->reconfig_mutex){+.+.}-{4:4}:
       check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3165
       check_prevs_add kernel/locking/lockdep.c:3284 [inline]
       validate_chain kernel/locking/lockdep.c:3908 [inline]
       __lock_acquire+0x136c/0x1a40 kernel/locking/lockdep.c:5237
       lock_acquire kernel/locking/lockdep.c:5868 [inline]
       lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
       __mutex_lock_common kernel/locking/mutex.c:646 [inline]
       __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821
       mddev_lock_nointr drivers/md/md.h:735 [inline]
       md_start_sync+0x79/0xbe0 drivers/md/md.c:10190
       process_one_work+0xa23/0x1940 kernel/workqueue.c:3322
       process_scheduled_works kernel/workqueue.c:3405 [inline]
       worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486
       kthread+0x370/0x450 kernel/kthread.c:436
       ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158
       ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

other info that might help us debug this:

Chain exists of:
  &mddev->reconfig_mutex --> (wq_completion)md_misc --> (work_completion)(&mddev->sync_work)

 Possible unsafe locking scenario:

       CPU0                    CPU1
       ----                    ----
  lock((work_completion)(&mddev->sync_work));
                               lock((wq_completion)md_misc);
                               lock((work_completion)(&mddev->sync_work));
  lock(&mddev->reconfig_mutex);

 *** DEADLOCK ***

2 locks held by kworker/0:7/5865:
 #0: ffff888020ee8d40 ((wq_completion)md_misc){+.+.}-{0:0}, at: process_one_work+0x12b1/0x1940 kernel/workqueue.c:3297
 #1: ffffc900044bfd08 ((work_completion)(&mddev->sync_work)){+.+.}-{0:0}, at: process_one_work+0x988/0x1940 kernel/workqueue.c:3298

stack backtrace:
CPU: 0 UID: 0 PID: 5865 Comm: kworker/0:7 Tainted: G             L      syzkaller #0 PREEMPT(full) 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/16/2026
Workqueue: md_misc md_start_sync
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120
 print_circular_bug.cold+0x178/0x1c7 kernel/locking/lockdep.c:2043
 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2175
 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3165
 check_prevs_add kernel/locking/lockdep.c:3284 [inline]
 validate_chain kernel/locking/lockdep.c:3908 [inline]
 __lock_acquire+0x136c/0x1a40 kernel/locking/lockdep.c:5237
 lock_acquire kernel/locking/lockdep.c:5868 [inline]
 lock_acquire+0x1b9/0x370 kernel/locking/lockdep.c:5825
 __mutex_lock_common kernel/locking/mutex.c:646 [inline]
 __mutex_lock+0x1a4/0x1bd0 kernel/locking/mutex.c:821
 mddev_lock_nointr drivers/md/md.h:735 [inline]
 md_start_sync+0x79/0xbe0 drivers/md/md.c:10190
 process_one_work+0xa23/0x1940 kernel/workqueue.c:3322
 process_scheduled_works kernel/workqueue.c:3405 [inline]
 worker_thread+0x5ef/0xe50 kernel/workqueue.c:3486
 kthread+0x370/0x450 kernel/kthread.c:436
 ret_from_fork+0x72b/0xd50 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
 </TASK>

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/07/28 12:38 upstream 62cc90241548 45ae1df4 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-badwrites-root possible deadlock in md_start_sync
2026/07/28 02:25 upstream f5098b6bae76 4cb2b096 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root possible deadlock in md_start_sync
2026/08/01 13:16 upstream 02dc699f83d0 e611ffe1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/31 23:30 upstream a2cf4ef33184 e611ffe1 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/31 11:22 upstream 8ba098e6b6ff db462e94 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/31 11:22 upstream 8ba098e6b6ff db462e94 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/30 02:16 upstream fc46aed51f62 2377cd3d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/30 02:16 upstream fc46aed51f62 2377cd3d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/29 21:55 upstream fc02acf6ac0c 2377cd3d .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/29 09:30 upstream fc02acf6ac0c 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/29 08:54 upstream fc02acf6ac0c 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/28 11:43 upstream 62cc90241548 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
2026/07/28 01:45 upstream 62cc90241548 4a865b71 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 possible deadlock in md_start_sync
* Struck through repros no longer work on HEAD.