====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ kworker/0:4/5798 is trying to acquire lock: ffff888059f132f0 (kn->active#80){++++}-{0:0}, at: __kernfs_remove+0x426/0x830 fs/kernfs/dir.c:1486 but task is already holding lock: ffffc900046c7d00 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2632 [inline] ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_scheduled_works+0x975/0x1600 kernel/workqueue.c:2734 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 kernel/workqueue.c:2633 [inline] process_scheduled_works+0x9ab/0x1600 kernel/workqueue.c:2734 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 -> #2 ((wq_completion)md_misc){+.+.}-{0:0}: touch_wq_lockdep_map kernel/workqueue.c:3183 [inline] __flush_workqueue+0x169/0x1380 kernel/workqueue.c:3213 __md_stop+0x1a9/0x340 drivers/md/md.c:6476 md_stop+0x7a/0xc0 drivers/md/md.c:6502 raid_dtr+0x4f/0x70 drivers/md/dm-raid.c:3316 dm_table_destroy+0x19d/0x460 drivers/md/dm-table.c:197 table_load+0x5a7/0x7e0 drivers/md/dm-ioctl.c:1596 ctl_ioctl drivers/md/dm-ioctl.c:2115 [inline] dm_ctl_ioctl+0x975/0xd00 drivers/md/dm-ioctl.c:2137 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xfd/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 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+0x135/0xce0 kernel/locking/mutex.c:747 mddev_lock drivers/md/md.h:593 [inline] array_state_store+0x2ef/0xb00 drivers/md/md.c:4572 md_attr_store+0x19c/0x390 drivers/md/md.c:5756 kernfs_fop_write_iter+0x3a4/0x520 fs/kernfs/file.c:352 call_write_iter include/linux/fs.h:2019 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x474/0x9a0 fs/read_write.c:584 ksys_write+0x151/0x260 fs/read_write.c:637 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x55/0xb0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 -> #0 (kn->active#80){++++}-{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+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 kernfs_drain+0x31e/0x6d0 fs/kernfs/dir.c:500 __kernfs_remove+0x426/0x830 fs/kernfs/dir.c:1486 kernfs_remove_by_name_ns+0xdc/0x150 fs/kernfs/dir.c:1695 kernfs_remove_by_name include/linux/kernfs.h:624 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0x101/0x290 fs/sysfs/group.c:292 sysfs_remove_groups+0x54/0xa0 fs/sysfs/group.c:316 __kobject_del+0x83/0x2e0 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+0x233/0x450 lib/kobject.c:737 process_one_work kernel/workqueue.c:2657 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 other info that might help us debug this: Chain exists of: kn->active#80 --> (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#80); *** DEADLOCK *** 2 locks held by kworker/0:4/5798: #0: ffff888147274938 ((wq_completion)md_misc){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2632 [inline] #0: ffff888147274938 ((wq_completion)md_misc){+.+.}-{0:0}, at: process_scheduled_works+0x975/0x1600 kernel/workqueue.c:2734 #1: ffffc900046c7d00 ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:2632 [inline] ((work_completion)(&mddev->del_work)){+.+.}-{0:0}, at: process_scheduled_works+0x975/0x1600 kernel/workqueue.c:2734 stack backtrace: CPU: 0 PID: 5798 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+0x18c/0x250 lib/dump_stack.c:106 check_noncircular+0x2fc/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+0x3a07/0x7eb0 kernel/locking/lockdep.c:5171 lock_acquire+0x19e/0x420 kernel/locking/lockdep.c:5790 kernfs_drain+0x31e/0x6d0 fs/kernfs/dir.c:500 __kernfs_remove+0x426/0x830 fs/kernfs/dir.c:1486 kernfs_remove_by_name_ns+0xdc/0x150 fs/kernfs/dir.c:1695 kernfs_remove_by_name include/linux/kernfs.h:624 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0x101/0x290 fs/sysfs/group.c:292 sysfs_remove_groups+0x54/0xa0 fs/sysfs/group.c:316 __kobject_del+0x83/0x2e0 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+0x233/0x450 lib/kobject.c:737 process_one_work kernel/workqueue.c:2657 [inline] process_scheduled_works+0xa60/0x1600 kernel/workqueue.c:2734 worker_thread+0xa5e/0xfe0 kernel/workqueue.c:2815 kthread+0x2fa/0x390 kernel/kthread.c:388 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:152 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:293 kernfs reshape_position: removing kernfs reshape_direction: removing kernfs array_size: removing kernfs max_read_errors: removing kernfs consistency_policy: removing kernfs fail_last_dev: removing kernfs serialize_policy: removing kernfs location: removing kernfs space: removing kernfs time_base: removing kernfs backlog: removing kernfs chunksize: removing kernfs metadata: removing kernfs can_clear: removing kernfs max_backlog_used: removing kernfs bitmap: removing kernfs md: removing kobject: 'md' (ffff88805debc0f0): calling ktype release kernfs bdi: removing device: '9:3': device_unregister kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs subsystem: removing kernfs 9:3: removing kernfs uevent: removing kernfs read_ahead_kb: removing kernfs min_ratio: removing kernfs min_ratio_fine: removing kernfs max_ratio: removing kernfs max_ratio_fine: removing kernfs min_bytes: removing kernfs max_bytes: removing kernfs stable_pages_required: removing kernfs strict_limit: removing PM: Removing info for No Bus:9:3 kobject: '9:3' (ffff88802ee6d000): kobject_uevent_env kobject: '9:3' (ffff88802ee6d000): fill_kobj_path: path = '/devices/virtual/bdi/9:3' kernfs 9:3: removing kobject: '9:3' (ffff88802ee6d000): kobject_cleanup, parent 0000000000000000 kobject: '9:3' (ffff88802ee6d000): calling ktype release device: '9:3': device_create_release kobject: '9:3': free name kobject: 'queue' (ffff88802ee6b500): kobject_uevent_env kobject: 'queue' (ffff88802ee6b500): kobject_uevent_env: filter function caused the event to drop! kernfs read_ahead_kb: removing kernfs max_hw_sectors_kb: removing kernfs max_sectors_kb: removing kernfs max_segments: removing kernfs max_discard_segments: removing kernfs max_integrity_segments: removing kernfs max_segment_size: removing kernfs hw_sector_size: removing kernfs logical_block_size: removing kernfs physical_block_size: removing kernfs chunk_sectors: removing kernfs minimum_io_size: removing kernfs optimal_io_size: removing kernfs discard_granularity: removing kernfs discard_max_bytes: removing kernfs discard_max_hw_bytes: removing kernfs discard_zeroes_data: removing kernfs write_same_max_bytes: removing kernfs write_zeroes_max_bytes: removing kernfs zone_append_max_bytes: removing kernfs zone_write_granularity: removing kernfs rotational: removing kernfs zoned: removing kernfs nr_zones: removing kernfs nomerges: removing kernfs iostats: removing kernfs stable_writes: removing kernfs add_random: removing kernfs io_poll: removing kernfs write_cache: removing kernfs fua: removing kernfs dax: removing kernfs io_poll_delay: removing kernfs virt_boundary_mask: removing kernfs dma_alignment: removing kernfs queue: removing kobject: 'queue' (ffff88802ee6b500): kobject_cleanup, parent 0000000000000000 kobject: 'queue' (ffff88802ee6b500): calling ktype release kobject: 'queue': free name kobject: 'holders' (ffff88801db8e900): kobject_cleanup, parent ffff8880746581e8 kobject: 'holders' (ffff88801db8e900): auto cleanup kobject_del kernfs holders: removing kobject: 'holders' (ffff88801db8e900): calling ktype release kobject: (ffff88801db8e900): dynamic_kobj_release kobject: 'holders': free name kobject: 'slaves' (ffff88801db8e000): kobject_cleanup, parent ffff8880746581e8 kobject: 'slaves' (ffff88801db8e000): auto cleanup kobject_del kernfs slaves: removing kobject: 'slaves' (ffff88801db8e000): calling ktype release kobject: (ffff88801db8e000): dynamic_kobj_release kobject: 'slaves': free name kernfs md3: removing kernfs runtime_status: removing kernfs control: removing kernfs runtime_suspended_time: removing kernfs runtime_active_time: removing kernfs autosuspend_delay_ms: removing kernfs power: removing kernfs 9:3: removing kernfs dev: removing kernfs subsystem: removing kernfs md3: removing kernfs uevent: removing kernfs removable: removing kernfs range: removing kernfs ext_range: removing kernfs hidden: removing kernfs ro: removing kernfs size: removing kernfs alignment_offset: removing kernfs discard_alignment: removing kernfs capability: removing kernfs stat: removing kernfs inflight: removing kernfs events: removing kernfs events_async: removing kernfs events_poll_msecs: removing kernfs diskseq: removing kernfs partscan: removing kernfs make-it-fail: removing kernfs io-timeout-fail: removing kernfs enable: removing kernfs act_mask: removing kernfs pid: removing kernfs start_lba: removing kernfs end_lba: removing kernfs trace: removing kernfs format: removing kernfs tag_size: removing kernfs protection_interval_bytes: removing kernfs read_verify: removing kernfs write_generate: removing kernfs device_is_integrity_capable: removing kernfs integrity: removing PM: Removing info for No Bus:md3 kobject: 'md3' (ffff8880746581e8): kobject_uevent_env kobject: 'md3' (ffff8880746581e8): fill_kobj_path: path = '/devices/virtual/block/md3' kernfs md3: removing kobject: 'md': free name kobject: 'md3' (ffff8880746581e8): kobject_cleanup, parent 0000000000000000 kobject: 'md3' (ffff8880746581e8): calling ktype release kobject: 'md3': free name Added buffer head 0 to ffff888142a48600 Added buffer head 0 to ffff888142a48600 Added buffer head 0 to ffff888142a48600 Added buffer head 0 to ffff888142a48600 Added buffer head 0 to ffff888142a48600 Added buffer head 0 to ffff888142a48600 Added buffer head 0 to ffff888142a48600