====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/1:1/35 is trying to acquire lock: ffff8880628ddf08 (kn->active#79){++++}-{0:0}, at: __kernfs_remove+0x493/0x910 fs/kernfs/dir.c:1578 but task is already holding lock: ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:309 [inline] ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3361 [inline] ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_scheduled_works+0x97a/0x1630 kernel/workqueue.c:3479 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}: process_one_work kernel/workqueue.c:3372 [inline] process_scheduled_works+0xc03/0x1630 kernel/workqueue.c:3479 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3560 kthread+0x38b/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #3 ((wq_completion)md_misc){+.+.}-{0:0}: touch_wq_lockdep_map+0xcb/0x180 kernel/workqueue.c:4111 __flush_workqueue+0x148/0x1470 kernel/workqueue.c:4153 md_alloc+0x32/0xf20 drivers/md/md.c:6334 md_alloc_and_put+0x1a/0x1f0 drivers/md/md.c:6423 blk_probe_dev block/genhd.c:888 [inline] blk_request_module+0x27d/0x2a0 block/genhd.c:-1 blkdev_get_no_open+0x3f/0xe0 block/bdev.c:870 blkdev_open+0x1e9/0x630 block/fops.c:671 do_dentry_open+0x841/0x1410 fs/open.c:1000 vfs_open_consume+0x4a/0x360 fs/open.c:1131 do_open fs/namei.c:4845 [inline] path_openat+0x1701/0x2100 fs/namei.c:5010 do_file_open+0x23e/0x4a0 fs/namei.c:5039 do_sys_openat2+0x115/0x200 fs/open.c:1442 do_sys_open fs/open.c:1448 [inline] __do_sys_openat fs/open.c:1464 [inline] __se_sys_openat fs/open.c:1459 [inline] __x64_sys_openat+0x138/0x170 fs/open.c:1459 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #2 (major_names_lock){+.+.}-{4:4}: __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline] mutex_lock_nested+0x55/0x1d0 kernel/locking/rtmutex_api.c:580 blk_probe_dev block/genhd.c:885 [inline] blk_request_module+0x35/0x2a0 block/genhd.c:901 blkdev_get_no_open+0x3f/0xe0 block/bdev.c:870 bdev_file_open_by_dev+0xa0/0x240 block/bdev.c:1091 md_import_device+0x2e9/0x650 drivers/md/md.c:3847 new_dev_store+0x46d/0x860 drivers/md/md.c:-1 md_attr_store+0x3b7/0x640 drivers/md/md.c:6158 kernfs_fop_write_iter+0x3a5/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x61e/0xbb0 fs/read_write.c:687 ksys_write+0x156/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #1 (&mddev->reconfig_mutex){+.+.}-{4:4}: __mutex_lock_common kernel/locking/rtmutex_api.c:561 [inline] mutex_lock_interruptible_nested+0x55/0x1c0 kernel/locking/rtmutex_api.c:594 mddev_lock drivers/md/md.h:713 [inline] array_state_store+0x4a5/0xe90 drivers/md/md.c:4705 md_attr_store+0x3b7/0x640 drivers/md/md.c:6158 kernfs_fop_write_iter+0x3a5/0x540 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x61e/0xbb0 fs/read_write.c:687 ksys_write+0x156/0x270 fs/read_write.c:739 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline] do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (kn->active#79){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 kernfs_drain+0x293/0x640 fs/kernfs/dir.c:534 __kernfs_remove+0x493/0x910 fs/kernfs/dir.c:1578 kernfs_remove_by_name_ns+0xc0/0x140 fs/kernfs/dir.c:1796 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0x101/0x2e0 fs/sysfs/group.c:328 sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:352 __kobject_del+0x83/0x320 lib/kobject.c:595 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x23a/0x550 lib/kobject.c:737 process_one_work kernel/workqueue.c:3396 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3479 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3560 kthread+0x38b/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 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: kn->active#79 --> (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#79); *** DEADLOCK *** locks held by kworker/1:1/35: 2, last CPU#1: #0: ffff888022e8c138 ((wq_completion)md_misc){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:309 [inline] #0: ffff888022e8c138 ((wq_completion)md_misc){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #0: ffff888022e8c138 ((wq_completion)md_misc){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3361 [inline] #0: ffff888022e8c138 ((wq_completion)md_misc){+.+.}-{0:0}, at: process_scheduled_works+0x97a/0x1630 kernel/workqueue.c:3479 #1: ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:309 [inline] #1: ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline] #1: ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3361 [inline] #1: ffffc90000ac7c40 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_scheduled_works+0x97a/0x1630 kernel/workqueue.c:3479 stack backtrace: CPU: 1 UID: 0 PID: 35 Comm: kworker/1:1 Not tainted syzkaller #0 PREEMPT_{RT,(full)} Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Workqueue: md_misc mddev_delayed_delete Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087 check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219 check_prev_add kernel/locking/lockdep.c:3209 [inline] check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288 lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942 kernfs_drain+0x293/0x640 fs/kernfs/dir.c:534 __kernfs_remove+0x493/0x910 fs/kernfs/dir.c:1578 kernfs_remove_by_name_ns+0xc0/0x140 fs/kernfs/dir.c:1796 kernfs_remove_by_name include/linux/kernfs.h:644 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0x101/0x2e0 fs/sysfs/group.c:328 sysfs_remove_groups+0x54/0xb0 fs/sysfs/group.c:352 __kobject_del+0x83/0x320 lib/kobject.c:595 kobject_cleanup lib/kobject.c:680 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x23a/0x550 lib/kobject.c:737 process_one_work kernel/workqueue.c:3396 [inline] process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3479 worker_thread+0xa47/0xfb0 kernel/workqueue.c:3560 kthread+0x38b/0x470 kernel/kthread.c:436 ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245