====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/0:4/4351 is trying to acquire lock: ffff88807d1f9ae8 (kn->active#66){++++}-{0:0}, at: __kernfs_remove+0x3f4/0x6c0 fs/kernfs/dir.c:1461 but task is already holding lock: ffffc900043f7d00 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_one_work+0x7b4/0x1160 kernel/workqueue.c:2267 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}: process_one_work+0x7ec/0x1160 kernel/workqueue.c:2268 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 -> #2 ((wq_completion)md_misc){+.+.}-{0:0}: __flush_workqueue+0x165/0x1380 kernel/workqueue.c:2816 __md_stop+0x1a3/0x330 drivers/md/md.c:6363 md_stop+0x76/0xc0 drivers/md/md.c:6389 raid_dtr+0x4b/0x60 drivers/md/dm-raid.c:3319 dm_table_destroy+0x199/0x460 drivers/md/dm-table.c:196 table_load+0x5e6/0x760 drivers/md/dm-ioctl.c:1548 ctl_ioctl drivers/md/dm-ioctl.c:2070 [inline] dm_ctl_ioctl+0xa9c/0xec0 drivers/md/dm-ioctl.c:2092 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xfa/0x170 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #1 (&mddev->reconfig_mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x12d/0xb40 kernel/locking/mutex.c:747 mddev_lock drivers/md/md.h:577 [inline] array_state_store+0x2e4/0x9c0 drivers/md/md.c:4480 md_attr_store+0x183/0x220 drivers/md/md.c:5634 kernfs_fop_write_iter+0x3a0/0x520 fs/kernfs/file.c:352 call_write_iter include/linux/fs.h:2271 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x482/0x9a0 fs/read_write.c:584 ksys_write+0x14d/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (kn->active#66){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171 lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790 kernfs_drain+0x31a/0x6d0 fs/kernfs/dir.c:499 __kernfs_remove+0x3f4/0x6c0 fs/kernfs/dir.c:1461 kernfs_remove_by_name_ns+0xd8/0x150 fs/kernfs/dir.c:1667 kernfs_remove_by_name include/linux/kernfs.h:622 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0xfd/0x290 fs/sysfs/group.c:288 sysfs_remove_groups+0x50/0xa0 fs/sysfs/group.c:312 __kobject_del+0x83/0x2e0 lib/kobject.c:587 kobject_cleanup lib/kobject.c:672 [inline] kobject_release lib/kobject.c:712 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x450 lib/kobject.c:729 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 other info that might help us debug this: Chain exists of: kn->active#66 --> (wq_completion)md_misc --> (work_completion)(&mddev->del_work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&mddev->del_work)); lock((wq_completion)md_misc); lock((work_completion)(&mddev->del_work)); lock(kn->active#66); *** DEADLOCK *** 2 locks held by kworker/0:4/4351: #0: ffff88801e641d38 ((wq_completion)md_misc){+.+.}-{0:0}, at: process_one_work+0x7b4/0x1160 kernel/workqueue.c:2267 #1: ffffc900043f7d00 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_one_work+0x7b4/0x1160 kernel/workqueue.c:2267 stack backtrace: CPU: 0 PID: 4351 Comm: kworker/0:4 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026 Workqueue: md_misc mddev_delayed_delete Call Trace: dump_stack_lvl+0x188/0x24e lib/dump_stack.c:106 check_noncircular+0x2f8/0x400 kernel/locking/lockdep.c:2215 check_prev_add kernel/locking/lockdep.c:3162 [inline] check_prevs_add kernel/locking/lockdep.c:3281 [inline] validate_chain kernel/locking/lockdep.c:3897 [inline] __lock_acquire+0x3a03/0x7ea0 kernel/locking/lockdep.c:5171 lock_acquire+0x1bc/0x4a0 kernel/locking/lockdep.c:5790 kernfs_drain+0x31a/0x6d0 fs/kernfs/dir.c:499 __kernfs_remove+0x3f4/0x6c0 fs/kernfs/dir.c:1461 kernfs_remove_by_name_ns+0xd8/0x150 fs/kernfs/dir.c:1667 kernfs_remove_by_name include/linux/kernfs.h:622 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0xfd/0x290 fs/sysfs/group.c:288 sysfs_remove_groups+0x50/0xa0 fs/sysfs/group.c:312 __kobject_del+0x83/0x2e0 lib/kobject.c:587 kobject_cleanup lib/kobject.c:672 [inline] kobject_release lib/kobject.c:712 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x450 lib/kobject.c:729 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