====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc7-syzkaller-00123-g3a568e3a961b #0 Not tainted ------------------------------------------------------ syz-executor.3/32444 is trying to acquire lock: ffff888036ab60e0 (&type->s_umount_key#120){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline] ffff888036ab60e0 (&type->s_umount_key#120){++++}-{3:3}, at: super_lock+0x176/0x390 fs/super.c:117 but task is already holding lock: ffff888148c92f08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: bdev_mark_dead+0x32/0x1a0 block/bdev.c:961 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #4 (&bdev->bd_holder_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 bd_finish_claiming+0x231/0x3f0 block/bdev.c:566 blkdev_get_by_dev+0x481/0x620 block/bdev.c:799 setup_bdev_super+0x5d/0x600 fs/super.c:1484 mount_bdev+0x1e0/0x300 fs/super.c:1626 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x280 fs/super.c:1750 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 init_mount+0xd4/0x130 fs/init.c:25 do_mount_root+0x98/0x230 init/do_mounts.c:166 mount_root_generic+0x193/0x3b0 init/do_mounts.c:205 prepare_namespace+0xc2/0x100 init/do_mounts.c:489 kernel_init_freeable+0x46a/0x5c0 init/main.c:1560 kernel_init+0x1d/0x2a0 init/main.c:1437 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 -> #3 (bdev_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 bd_prepare_to_claim+0x1b0/0x4c0 block/bdev.c:508 truncate_bdev_range+0x4e/0x260 block/bdev.c:105 blkdev_fallocate+0x4d2/0x660 block/fops.c:782 vfs_fallocate+0x551/0x6b0 fs/open.c:324 ksys_fallocate fs/open.c:347 [inline] __do_sys_fallocate fs/open.c:355 [inline] __se_sys_fallocate fs/open.c:353 [inline] __x64_sys_fallocate+0xbd/0x100 fs/open.c:353 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #2 (mapping.invalidate_lock#2){++++}-{3:3}: down_read+0xb1/0xa40 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:857 [inline] page_cache_ra_unbounded+0xf1/0x7c0 mm/readahead.c:225 page_cache_sync_readahead include/linux/pagemap.h:1293 [inline] cramfs_blkdev_read fs/cramfs/inode.c:218 [inline] cramfs_read+0x4c9/0xa70 fs/cramfs/inode.c:278 cramfs_read_super+0xbe/0x970 fs/cramfs/inode.c:522 cramfs_blkdev_fill_super+0x115/0x250 fs/cramfs/inode.c:622 get_tree_bdev+0x416/0x5b0 fs/super.c:1577 vfs_get_tree+0x8c/0x280 fs/super.c:1750 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #1 (read_mutex){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x136/0xd60 kernel/locking/mutex.c:747 cramfs_read_super+0xaf/0x970 fs/cramfs/inode.c:521 cramfs_blkdev_fill_super+0x115/0x250 fs/cramfs/inode.c:622 get_tree_bdev+0x416/0x5b0 fs/super.c:1577 vfs_get_tree+0x8c/0x280 fs/super.c:1750 do_new_mount+0x28f/0xae0 fs/namespace.c:3335 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd -> #0 (&type->s_umount_key#120){++++}-{3:3}: check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1520 __super_lock fs/super.c:58 [inline] super_lock+0x176/0x390 fs/super.c:117 super_lock_shared fs/super.c:146 [inline] super_lock_shared_active fs/super.c:1431 [inline] fs_bdev_mark_dead+0xa9/0x1f0 fs/super.c:1447 bdev_mark_dead+0x85/0x1a0 block/bdev.c:963 disk_force_media_change+0x145/0x1c0 block/disk-events.c:302 __loop_clr_fd+0x3df/0x690 drivers/block/loop.c:1174 loop_clr_fd drivers/block/loop.c:1257 [inline] lo_ioctl+0x16d3/0x2080 drivers/block/loop.c:1563 blkdev_ioctl+0x5cf/0x730 block/ioctl.c:630 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd other info that might help us debug this: Chain exists of: &type->s_umount_key#120 --> bdev_lock --> &bdev->bd_holder_lock Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&bdev->bd_holder_lock); lock(bdev_lock); lock(&bdev->bd_holder_lock); rlock(&type->s_umount_key#120); *** DEADLOCK *** 1 lock held by syz-executor.3/32444: #0: ffff888148c92f08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: bdev_mark_dead+0x32/0x1a0 block/bdev.c:961 stack backtrace: CPU: 0 PID: 32444 Comm: syz-executor.3 Not tainted 6.6.0-rc7-syzkaller-00123-g3a568e3a961b #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 check_noncircular+0x375/0x4a0 kernel/locking/lockdep.c:2187 check_prev_add kernel/locking/lockdep.c:3134 [inline] check_prevs_add kernel/locking/lockdep.c:3253 [inline] validate_chain kernel/locking/lockdep.c:3868 [inline] __lock_acquire+0x39ff/0x7f70 kernel/locking/lockdep.c:5136 lock_acquire+0x1e3/0x520 kernel/locking/lockdep.c:5753 down_read+0xb1/0xa40 kernel/locking/rwsem.c:1520 __super_lock fs/super.c:58 [inline] super_lock+0x176/0x390 fs/super.c:117 super_lock_shared fs/super.c:146 [inline] super_lock_shared_active fs/super.c:1431 [inline] fs_bdev_mark_dead+0xa9/0x1f0 fs/super.c:1447 bdev_mark_dead+0x85/0x1a0 block/bdev.c:963 disk_force_media_change+0x145/0x1c0 block/disk-events.c:302 __loop_clr_fd+0x3df/0x690 drivers/block/loop.c:1174 loop_clr_fd drivers/block/loop.c:1257 [inline] lo_ioctl+0x16d3/0x2080 drivers/block/loop.c:1563 blkdev_ioctl+0x5cf/0x730 block/ioctl.c:630 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl+0xf8/0x170 fs/ioctl.c:857 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7ff8ce27c84b Code: 00 48 89 44 24 18 31 c0 48 8d 44 24 60 c7 04 24 10 00 00 00 48 89 44 24 08 48 8d 44 24 20 48 89 44 24 10 b8 10 00 00 00 0f 05 <89> c2 3d 00 f0 ff ff 77 1c 48 8b 44 24 18 64 48 2b 04 25 28 00 00 RSP: 002b:00007ff8cf094e90 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: ffffffffffffffff RCX: 00007ff8ce27c84b RDX: 0000000000000000 RSI: 0000000000004c01 RDI: 0000000000000006 RBP: 0000000000000013 R08: 00007ff8cf094f80 R09: 0000000001000801 R10: 0000000001000801 R11: 0000000000000246 R12: 0000000000000006 R13: 00007ff8cf094f40 R14: 00000000000001e0 R15: 00000000200003c0