====================================================== WARNING: possible circular locking dependency detected syzkaller #0 Not tainted ------------------------------------------------------ syz.3.138/6529 is trying to acquire lock: ffff88801cfc1540 ((wq_completion)md_misc){+.+.}-{0:0}, at: touch_wq_lockdep_map+0x9c/0x1c0 kernel/workqueue.c:4111 but task is already holding lock: ffffffff8f9be780 (major_names_lock){+.+.}-{4:4}, at: blk_probe_dev+0x28/0x1e0 block/genhd.c:885 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 (major_names_lock){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __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:885 blk_request_module+0x16/0xc0 block/genhd.c:901 blkdev_get_no_open+0x9b/0xf0 block/bdev.c:870 bdev_file_open_by_dev block/bdev.c:1091 [inline] bdev_file_open_by_dev+0x70/0x210 block/bdev.c:1079 md_import_device+0x120/0x360 drivers/md/md.c:3847 md_add_new_disk+0xdbf/0x1820 drivers/md/md.c:7656 md_ioctl+0x2bec/0x36d0 drivers/md/md.c:8499 compat_blkdev_ioctl+0x682/0x7b0 block/ioctl.c:854 __do_compat_sys_ioctl fs/ioctl.c:695 [inline] __se_compat_sys_ioctl fs/ioctl.c:638 [inline] __ia32_compat_sys_ioctl+0x2cf/0x360 fs/ioctl.c:638 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e -> #2 (&mddev->reconfig_mutex){+.+.}-{4:4}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 __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:734 [inline] md_start_sync+0x55f/0xea0 drivers/md/md.c:10275 process_one_work+0xac7/0x1b10 kernel/workqueue.c:3396 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #1 ((work_completion)(&mddev->sync_work)){+.+.}-{0:0}: lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 process_one_work+0xa32/0x1b10 kernel/workqueue.c:3372 process_scheduled_works kernel/workqueue.c:3479 [inline] worker_thread+0x5ef/0xe50 kernel/workqueue.c:3560 kthread+0x373/0x450 kernel/kthread.c:436 ret_from_fork+0x730/0xd60 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #0 ((wq_completion)md_misc){+.+.}-{0:0}: check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 touch_wq_lockdep_map+0xad/0x1c0 kernel/workqueue.c:4111 __flush_workqueue+0x131/0x1200 kernel/workqueue.c:4153 md_alloc+0x30/0x10a0 drivers/md/md.c:6334 md_alloc_and_put drivers/md/md.c:6423 [inline] md_probe drivers/md/md.c:6439 [inline] md_probe+0x73/0xf0 drivers/md/md.c:6434 blk_probe_dev+0x149/0x1e0 block/genhd.c:888 blk_request_module+0x16/0xc0 block/genhd.c:901 blkdev_get_no_open+0x9b/0xf0 block/bdev.c:870 bdev_file_open_by_dev block/bdev.c:1091 [inline] bdev_file_open_by_dev+0x70/0x210 block/bdev.c:1079 swsusp_check+0x72/0x470 kernel/power/swap.c:1574 software_resume+0x6f/0x330 kernel/power/hibernate.c:1025 resume_store+0x248/0x460 kernel/power/hibernate.c:1309 kobj_attr_store+0x58/0x80 lib/kobject.c:842 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6af/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e other info that might help us debug this: Chain exists of: (wq_completion)md_misc --> &mddev->reconfig_mutex --> major_names_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(major_names_lock); lock(&mddev->reconfig_mutex); lock(major_names_lock); lock((wq_completion)md_misc); *** DEADLOCK *** locks held by syz.3.138/6529: 6, last CPU#1: #0: ffff888014322ef0 (&f->f_pos_lock){+.+.}-{4:4}, at: fdget_pos+0x2aa/0x380 fs/file.c:1259 #1: ffff888025142460 (sb_writers#7){.+.+}-{0:0}, at: ksys_write+0x12a/0x250 fs/read_write.c:739 #2: ffff888029834480 (&of->mutex){+.+.}-{4:4}, at: kernfs_fop_write_iter+0x2c2/0x5f0 fs/kernfs/file.c:336 #3: ffff88801d7994b8 (kn->active#72){.+.+}-{0:0}, at: kernfs_get_active_of fs/kernfs/file.c:73 [inline] #3: ffff88801d7994b8 (kn->active#72){.+.+}-{0:0}, at: kernfs_fop_write_iter+0x332/0x5f0 fs/kernfs/file.c:337 #4: ffffffff8eca2700 (system_transition_mutex){+.+.}-{4:4}, at: software_resume+0x65/0x330 kernel/power/hibernate.c:1024 #5: ffffffff8f9be780 (major_names_lock){+.+.}-{4:4}, at: blk_probe_dev+0x28/0x1e0 block/genhd.c:885 stack backtrace: CPU: 1 UID: 0 PID: 6529 Comm: syz.3.138 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_circular_bug.cold+0x178/0x1be kernel/locking/lockdep.c:2087 check_noncircular+0x146/0x160 kernel/locking/lockdep.c:2219 check_prev_add+0xeb/0xe60 kernel/locking/lockdep.c:3209 check_prevs_add kernel/locking/lockdep.c:3328 [inline] validate_chain kernel/locking/lockdep.c:3952 [inline] __lock_acquire+0x1528/0x1f40 kernel/locking/lockdep.c:5288 lock_acquire kernel/locking/lockdep.c:5942 [inline] lock_acquire+0x1d1/0x380 kernel/locking/lockdep.c:5899 touch_wq_lockdep_map+0xad/0x1c0 kernel/workqueue.c:4111 __flush_workqueue+0x131/0x1200 kernel/workqueue.c:4153 md_alloc+0x30/0x10a0 drivers/md/md.c:6334 md_alloc_and_put drivers/md/md.c:6423 [inline] md_probe drivers/md/md.c:6439 [inline] md_probe+0x73/0xf0 drivers/md/md.c:6434 blk_probe_dev+0x149/0x1e0 block/genhd.c:888 blk_request_module+0x16/0xc0 block/genhd.c:901 blkdev_get_no_open+0x9b/0xf0 block/bdev.c:870 bdev_file_open_by_dev block/bdev.c:1091 [inline] bdev_file_open_by_dev+0x70/0x210 block/bdev.c:1079 swsusp_check+0x72/0x470 kernel/power/swap.c:1574 software_resume+0x6f/0x330 kernel/power/hibernate.c:1025 resume_store+0x248/0x460 kernel/power/hibernate.c:1309 kobj_attr_store+0x58/0x80 lib/kobject.c:842 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6af/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x13a/0x8b0 arch/x86/entry/syscall_32.c:291 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:316 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf709efec Code: Unable to access opcode bytes at 0xf709efc2. RSP: 002b:00000000f546c50c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000080000040 RDX: 0000000000000012 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 md: async del_gendisk mode will be removed in future, please upgrade to mdadm-4.5+ block device autoloading is deprecated and will be removed. PM: Image not found (code -5)