loop0: [CUMANA/ADFS] p1 [ADFS] p1 loop0: partition table partially beyond EOD, truncated loop0: p1 size 3797445902 extends beyond EOD, truncated ====================================================== WARNING: possible circular locking dependency detected 6.15.0-rc3-syzkaller-00094-g02ddfb981de8 #0 Not tainted ------------------------------------------------------ udevd/5308 is trying to acquire lock: ffff88803f73c1e8 (kn->active#5){++++}-{0:0}, at: __kernfs_remove+0x33b/0x570 fs/kernfs/dir.c:1506 but task is already holding lock: ffff888032e26358 (&disk->open_mutex){+.+.}-{4:4}, at: bdev_release+0x1a9/0x650 block/bdev.c:1090 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&disk->open_mutex){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x182/0xe80 kernel/locking/mutex.c:746 bdev_open+0xe0/0xd30 block/bdev.c:907 bdev_file_open_by_dev+0x1b9/0x230 block/bdev.c:1021 disk_scan_partitions+0x1c1/0x2c0 block/genhd.c:374 add_disk_fwnode+0xdbc/0x10e0 block/genhd.c:526 pmem_attach_disk+0xbc7/0xdc0 drivers/nvdimm/pmem.c:574 nvdimm_bus_probe+0x144/0x490 drivers/nvdimm/bus.c:94 call_driver_probe drivers/base/dd.c:-1 [inline] really_probe+0x26a/0x9a0 drivers/base/dd.c:658 __driver_probe_device+0x18c/0x2f0 drivers/base/dd.c:800 driver_probe_device+0x4f/0x430 drivers/base/dd.c:830 __driver_attach+0x452/0x700 drivers/base/dd.c:1216 bus_for_each_dev+0x230/0x2b0 drivers/base/bus.c:370 bus_add_driver+0x345/0x640 drivers/base/bus.c:678 driver_register+0x23a/0x320 drivers/base/driver.c:249 do_one_initcall+0x233/0x820 init/main.c:1257 do_initcall_level+0x137/0x1f0 init/main.c:1319 do_initcalls+0x69/0xd0 init/main.c:1335 kernel_init_freeable+0x3d9/0x570 init/main.c:1567 kernel_init+0x1d/0x1d0 init/main.c:1457 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 -> #1 (&nvdimm_namespace_key){+.+.}-{4:4}: lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 __mutex_lock_common kernel/locking/mutex.c:601 [inline] __mutex_lock+0x182/0xe80 kernel/locking/mutex.c:746 device_lock include/linux/device.h:922 [inline] uevent_show+0x174/0x330 drivers/base/core.c:2730 dev_attr_show+0x55/0xc0 drivers/base/core.c:2424 sysfs_kf_seq_show+0x30d/0x490 fs/sysfs/file.c:65 seq_read_iter+0x4e7/0xe10 fs/seq_file.c:230 new_sync_read fs/read_write.c:489 [inline] vfs_read+0x4cd/0x980 fs/read_write.c:570 ksys_read+0x145/0x250 fs/read_write.c:713 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f -> #0 (kn->active#5){++++}-{0:0}: check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3909 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 kernfs_drain+0x27a/0x5e0 fs/kernfs/dir.c:511 __kernfs_remove+0x33b/0x570 fs/kernfs/dir.c:1506 kernfs_remove_by_name_ns+0xaf/0x130 fs/kernfs/dir.c:1714 sysfs_remove_file include/linux/sysfs.h:794 [inline] device_remove_file drivers/base/core.c:3048 [inline] device_del+0x4f0/0x8e0 drivers/base/core.c:3853 drop_partition+0x11b/0x180 block/partitions/core.c:278 bdev_disk_changed+0x28c/0x14b0 block/partitions/core.c:674 __loop_clr_fd drivers/block/loop.c:1129 [inline] lo_release+0x514/0x7e0 drivers/block/loop.c:1696 bdev_release+0x533/0x650 block/bdev.c:-1 blkdev_release+0x15/0x20 block/fops.c:660 __fput+0x449/0xa70 fs/file_table.c:465 fput_close_sync+0x169/0x200 fs/file_table.c:570 __do_sys_close fs/open.c:1581 [inline] __se_sys_close fs/open.c:1566 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1566 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f other info that might help us debug this: Chain exists of: kn->active#5 --> &nvdimm_namespace_key --> &disk->open_mutex Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&disk->open_mutex); lock(&nvdimm_namespace_key); lock(&disk->open_mutex); lock(kn->active#5); *** DEADLOCK *** 1 lock held by udevd/5308: #0: ffff888032e26358 (&disk->open_mutex){+.+.}-{4:4}, at: bdev_release+0x1a9/0x650 block/bdev.c:1090 stack backtrace: CPU: 0 UID: 0 PID: 5308 Comm: udevd Not tainted 6.15.0-rc3-syzkaller-00094-g02ddfb981de8 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_circular_bug+0x2ee/0x310 kernel/locking/lockdep.c:2079 check_noncircular+0x134/0x160 kernel/locking/lockdep.c:2211 check_prev_add kernel/locking/lockdep.c:3166 [inline] check_prevs_add kernel/locking/lockdep.c:3285 [inline] validate_chain+0xb9b/0x2140 kernel/locking/lockdep.c:3909 __lock_acquire+0xaac/0xd20 kernel/locking/lockdep.c:5235 lock_acquire+0x120/0x360 kernel/locking/lockdep.c:5866 kernfs_drain+0x27a/0x5e0 fs/kernfs/dir.c:511 __kernfs_remove+0x33b/0x570 fs/kernfs/dir.c:1506 kernfs_remove_by_name_ns+0xaf/0x130 fs/kernfs/dir.c:1714 sysfs_remove_file include/linux/sysfs.h:794 [inline] device_remove_file drivers/base/core.c:3048 [inline] device_del+0x4f0/0x8e0 drivers/base/core.c:3853 drop_partition+0x11b/0x180 block/partitions/core.c:278 bdev_disk_changed+0x28c/0x14b0 block/partitions/core.c:674 __loop_clr_fd drivers/block/loop.c:1129 [inline] lo_release+0x514/0x7e0 drivers/block/loop.c:1696 bdev_release+0x533/0x650 block/bdev.c:-1 blkdev_release+0x15/0x20 block/fops.c:660 __fput+0x449/0xa70 fs/file_table.c:465 fput_close_sync+0x169/0x200 fs/file_table.c:570 __do_sys_close fs/open.c:1581 [inline] __se_sys_close fs/open.c:1566 [inline] __x64_sys_close+0x7f/0x110 fs/open.c:1566 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f8dd7b170a8 Code: 48 8b 05 83 9d 0d 00 64 c7 00 16 00 00 00 83 c8 ff 48 83 c4 20 5b c3 64 8b 04 25 18 00 00 00 85 c0 75 20 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 5b 48 8b 15 51 9d 0d 00 f7 d8 64 89 02 48 83 RSP: 002b:00007ffd4cb98a58 EFLAGS: 00000246 ORIG_RAX: 0000000000000003 RAX: ffffffffffffffda RBX: 00007f8dd7f860e0 RCX: 00007f8dd7b170a8 RDX: 000055d8d6fa4874 RSI: 00007ffd4cb98258 RDI: 0000000000000008 RBP: 000055dd8b220440 R08: 0000000000000006 R09: 3b544aa8c7e92342 R10: 000000000000010f R11: 0000000000000246 R12: 0000000000000002 R13: 000055dd8b2079c0 R14: 0000000000000008 R15: 000055dd8b1fe910 udevd[5308]: inotify_add_watch(7, /dev/loop0p1, 10) failed: No such file or directory