====================================================== WARNING: possible circular locking dependency detected 6.6.0-rc3-syzkaller-00055-g9ed22ae6be81 #0 Not tainted ------------------------------------------------------ syz-executor.1/17456 is trying to acquire lock: ffff00000da0c0e0 (&type->s_umount_key#27){++++}-{3:3}, at: __super_lock fs/super.c:58 [inline] ffff00000da0c0e0 (&type->s_umount_key#27){++++}-{3:3}, at: super_lock+0x190/0x24c fs/super.c:117 but task is already holding lock: ffff00000a2cdd08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline] ffff00000a2cdd08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x78c/0x18f8 block/ioctl.c:502 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+0x134/0x840 kernel/locking/mutex.c:747 mutex_lock_nested+0x24/0x30 kernel/locking/mutex.c:799 bd_finish_claiming block/bdev.c:566 [inline] blkdev_get_by_dev.part.0+0x308/0x810 block/bdev.c:799 blkdev_get_by_dev+0x68/0x7c block/bdev.c:829 setup_bdev_super+0x68/0x518 fs/super.c:1484 get_tree_bdev+0x2ac/0x4bc fs/super.c:1574 ext4_get_tree+0x18/0x24 fs/ext4/super.c:5735 vfs_get_tree+0x74/0x27c fs/super.c:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x6e8/0x1604 fs/namespace.c:3662 init_mount+0xb0/0x100 fs/init.c:25 do_mount_root+0x100/0x29c init/do_mounts.c:166 mount_root_generic+0x20c/0x430 init/do_mounts.c:205 mount_block_root init/do_mounts.c:378 [inline] mount_root+0x15c/0x33c init/do_mounts.c:405 prepare_namespace+0xc4/0x2fc init/do_mounts.c:489 kernel_init_freeable+0x948/0xb9c init/main.c:1560 kernel_init+0x24/0x1dc init/main.c:1437 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:853 -> #3 (bdev_lock){+.+.}-{3:3}: __mutex_lock_common kernel/locking/mutex.c:603 [inline] __mutex_lock+0x134/0x840 kernel/locking/mutex.c:747 mutex_lock_nested+0x24/0x30 kernel/locking/mutex.c:799 bd_prepare_to_claim+0x14c/0x1f8 block/bdev.c:508 truncate_bdev_range+0x38/0x1dc block/bdev.c:105 blk_ioctl_zeroout block/ioctl.c:185 [inline] blkdev_common_ioctl+0x664/0x18f8 block/ioctl.c:510 blkdev_ioctl+0x1f0/0x7e4 block/ioctl.c:624 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __arm64_sys_ioctl+0x124/0x190 fs/ioctl.c:857 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x6c/0x258 arch/arm64/kernel/syscall.c:51 el0_svc_common.constprop.0+0xac/0x230 arch/arm64/kernel/syscall.c:136 do_el0_svc+0x40/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x140 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 -> #2 (mapping.invalidate_lock#2){++++}-{3:3}: down_read+0xb4/0x314 kernel/locking/rwsem.c:1520 filemap_invalidate_lock_shared include/linux/fs.h:857 [inline] page_cache_ra_unbounded+0x128/0x4c0 mm/readahead.c:225 do_page_cache_ra mm/readahead.c:299 [inline] ondemand_readahead+0xbb0/0xfd8 mm/readahead.c:641 page_cache_sync_ra+0x104/0x130 mm/readahead.c:695 page_cache_sync_readahead.constprop.0+0x90/0xc8 include/linux/pagemap.h:1293 ext4_readdir+0x6c0/0x254c fs/ext4/dir.c:194 iterate_dir+0x16c/0x468 fs/readdir.c:106 __do_sys_getdents64 fs/readdir.c:405 [inline] __se_sys_getdents64 fs/readdir.c:390 [inline] __arm64_sys_getdents64+0x10c/0x290 fs/readdir.c:390 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x6c/0x258 arch/arm64/kernel/syscall.c:51 el0_svc_common.constprop.0+0xac/0x230 arch/arm64/kernel/syscall.c:136 do_el0_svc+0x40/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x140 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 -> #1 (&type->i_mutex_dir_key#3){++++}-{3:3}: down_read+0xb4/0x314 kernel/locking/rwsem.c:1520 inode_lock_shared include/linux/fs.h:812 [inline] lookup_slow fs/namei.c:1709 [inline] lookup_one_unlocked+0xf4/0x120 fs/namei.c:2806 lookup_one_positive_unlocked fs/namei.c:2835 [inline] lookup_positive_unlocked+0x2c/0x80 fs/namei.c:2875 dquot_quota_on_mount+0x54/0xd4 fs/quota/dquot.c:2520 ext4_quota_on_mount fs/ext4/orphan.c:316 [inline] ext4_orphan_cleanup+0x384/0xc2c fs/ext4/orphan.c:444 __ext4_fill_super fs/ext4/super.c:5582 [inline] ext4_fill_super+0x6d9c/0x8ac0 fs/ext4/super.c:5703 get_tree_bdev+0x2c8/0x4bc fs/super.c:1577 ext4_get_tree+0x18/0x24 fs/ext4/super.c:5735 vfs_get_tree+0x74/0x27c fs/super.c:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x6e8/0x1604 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __arm64_sys_mount+0x270/0x4dc fs/namespace.c:3861 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x6c/0x258 arch/arm64/kernel/syscall.c:51 el0_svc_common.constprop.0+0xac/0x230 arch/arm64/kernel/syscall.c:136 do_el0_svc+0x40/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x140 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 -> #0 (&type->s_umount_key#27){++++}-{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+0x2cac/0x6b70 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x480/0x7c8 kernel/locking/lockdep.c:5718 down_read+0xb4/0x314 kernel/locking/rwsem.c:1520 __super_lock fs/super.c:58 [inline] super_lock+0x190/0x24c fs/super.c:117 super_lock_shared fs/super.c:146 [inline] super_lock_shared_active fs/super.c:1431 [inline] fs_bdev_sync+0x78/0x11c fs/super.c:1466 blkdev_flushbuf block/ioctl.c:372 [inline] blkdev_common_ioctl+0x7d4/0x18f8 block/ioctl.c:502 blkdev_ioctl+0x1f0/0x7e4 block/ioctl.c:624 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __arm64_sys_ioctl+0x124/0x190 fs/ioctl.c:857 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x6c/0x258 arch/arm64/kernel/syscall.c:51 el0_svc_common.constprop.0+0xac/0x230 arch/arm64/kernel/syscall.c:136 do_el0_svc+0x40/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x140 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591 other info that might help us debug this: Chain exists of: &type->s_umount_key#27 --> 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#27); *** DEADLOCK *** 1 lock held by syz-executor.1/17456: #0: ffff00000a2cdd08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_flushbuf block/ioctl.c:370 [inline] #0: ffff00000a2cdd08 (&bdev->bd_holder_lock){+.+.}-{3:3}, at: blkdev_common_ioctl+0x78c/0x18f8 block/ioctl.c:502 stack backtrace: CPU: 0 PID: 17456 Comm: syz-executor.1 Not tainted 6.6.0-rc3-syzkaller-00055-g9ed22ae6be81 #0 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x9c/0x11c arch/arm64/kernel/stacktrace.c:233 show_stack+0x18/0x24 arch/arm64/kernel/stacktrace.c:240 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x74/0xd4 lib/dump_stack.c:106 dump_stack+0x1c/0x28 lib/dump_stack.c:113 print_circular_bug+0x420/0x6f8 kernel/locking/lockdep.c:2060 check_noncircular+0x2dc/0x364 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+0x2cac/0x6b70 kernel/locking/lockdep.c:5136 lock_acquire kernel/locking/lockdep.c:5753 [inline] lock_acquire+0x480/0x7c8 kernel/locking/lockdep.c:5718 down_read+0xb4/0x314 kernel/locking/rwsem.c:1520 __super_lock fs/super.c:58 [inline] super_lock+0x190/0x24c fs/super.c:117 super_lock_shared fs/super.c:146 [inline] super_lock_shared_active fs/super.c:1431 [inline] fs_bdev_sync+0x78/0x11c fs/super.c:1466 blkdev_flushbuf block/ioctl.c:372 [inline] blkdev_common_ioctl+0x7d4/0x18f8 block/ioctl.c:502 blkdev_ioctl+0x1f0/0x7e4 block/ioctl.c:624 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:871 [inline] __se_sys_ioctl fs/ioctl.c:857 [inline] __arm64_sys_ioctl+0x124/0x190 fs/ioctl.c:857 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall+0x6c/0x258 arch/arm64/kernel/syscall.c:51 el0_svc_common.constprop.0+0xac/0x230 arch/arm64/kernel/syscall.c:136 do_el0_svc+0x40/0x58 arch/arm64/kernel/syscall.c:155 el0_svc+0x58/0x140 arch/arm64/kernel/entry-common.c:678 el0t_64_sync_handler+0x100/0x12c arch/arm64/kernel/entry-common.c:696 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:591