====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.5/32655 is trying to acquire lock: 000000006f73effe (&dquot->dq_lock){+.+.}, at: dquot_commit+0x4d/0x400 fs/quota/dquot.c:469 but task is already holding lock: 00000000dd7852f0 (&ei->i_data_sem/2){++++}, at: ext4_truncate+0x746/0x1380 fs/ext4/inode.c:4552 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #2 (&ei->i_data_sem/2){++++}: ext4_map_blocks+0x33e/0x1a50 fs/ext4/inode.c:578 ext4_getblk+0xad/0x4f0 fs/ext4/inode.c:993 ext4_bread+0x7c/0x210 fs/ext4/inode.c:1043 ext4_quota_write+0x205/0x530 fs/ext4/super.c:6008 write_blk+0x10a/0x200 fs/quota/quota_tree.c:72 get_free_dqblk+0xff/0x2d0 fs/quota/quota_tree.c:101 do_insert_tree+0x79c/0x1150 fs/quota/quota_tree.c:308 do_insert_tree+0xf5c/0x1150 fs/quota/quota_tree.c:339 dq_insert_tree fs/quota/quota_tree.c:365 [inline] qtree_write_dquot+0x1cb/0x570 fs/quota/quota_tree.c:384 v2_write_dquot+0x11c/0x250 fs/quota/quota_v2.c:359 dquot_acquire+0x25c/0x490 fs/quota/dquot.c:436 ext4_acquire_dquot+0x1e7/0x2d0 fs/ext4/super.c:5666 dqget+0x785/0xfc0 fs/quota/dquot.c:896 __dquot_initialize+0x3bd/0xb70 fs/quota/dquot.c:1470 ext4_xattr_set+0xbd/0x2a0 fs/ext4/xattr.c:2499 __vfs_setxattr+0x10e/0x170 fs/xattr.c:149 __vfs_setxattr_noperm+0x11a/0x420 fs/xattr.c:180 __vfs_setxattr_locked+0x176/0x250 fs/xattr.c:238 vfs_setxattr+0xe5/0x270 fs/xattr.c:255 setxattr+0x23d/0x330 fs/xattr.c:520 path_setxattr+0x170/0x190 fs/xattr.c:539 __do_sys_setxattr fs/xattr.c:554 [inline] __se_sys_setxattr fs/xattr.c:550 [inline] __x64_sys_setxattr+0xc0/0x160 fs/xattr.c:550 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #1 (&s->s_dquot.dqio_sem){++++}: v2_read_dquot+0x49/0x120 fs/quota/quota_v2.c:333 dquot_acquire+0x121/0x490 fs/quota/dquot.c:428 ext4_acquire_dquot+0x1e7/0x2d0 fs/ext4/super.c:5666 dqget+0x785/0xfc0 fs/quota/dquot.c:896 __dquot_initialize+0x3bd/0xb70 fs/quota/dquot.c:1470 ext4_create+0x84/0x5f0 fs/ext4/namei.c:2510 lookup_open+0x893/0x1a20 fs/namei.c:3235 do_last fs/namei.c:3327 [inline] path_openat+0x1094/0x2df0 fs/namei.c:3537 do_filp_open+0x18c/0x3f0 fs/namei.c:3567 do_sys_open+0x3b3/0x520 fs/open.c:1085 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe -> #0 (&dquot->dq_lock){+.+.}: __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 dquot_commit+0x4d/0x400 fs/quota/dquot.c:469 ext4_write_dquot+0x1e7/0x280 fs/ext4/super.c:5650 ext4_mark_dquot_dirty+0x111/0x1a0 fs/ext4/super.c:5701 mark_dquot_dirty fs/quota/dquot.c:341 [inline] mark_all_dquot_dirty fs/quota/dquot.c:379 [inline] __dquot_free_space+0x5d4/0x9c0 fs/quota/dquot.c:1887 dquot_free_space_nodirty include/linux/quotaops.h:377 [inline] dquot_free_space include/linux/quotaops.h:382 [inline] dquot_free_block include/linux/quotaops.h:393 [inline] ext4_free_blocks+0x1922/0x2ac0 fs/ext4/mballoc.c:4950 ext4_remove_blocks fs/ext4/extents.c:2584 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2740 [inline] ext4_ext_remove_space+0x26ef/0x3e80 fs/ext4/extents.c:2973 ext4_ext_truncate+0x1ae/0x200 fs/ext4/extents.c:4670 ext4_truncate+0xe27/0x1380 fs/ext4/inode.c:4557 ext4_orphan_cleanup fs/ext4/super.c:2691 [inline] ext4_fill_super+0x82f7/0xc850 fs/ext4/super.c:4549 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe other info that might help us debug this: Chain exists of: &dquot->dq_lock --> &s->s_dquot.dqio_sem --> &ei->i_data_sem/2 Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&ei->i_data_sem/2); lock(&s->s_dquot.dqio_sem); lock(&ei->i_data_sem/2); lock(&dquot->dq_lock); *** DEADLOCK *** 4 locks held by syz-executor.5/32655: #0: 000000003349b35a (&type->s_umount_key#25/1){+.+.}, at: alloc_super fs/super.c:226 [inline] #0: 000000003349b35a (&type->s_umount_key#25/1){+.+.}, at: sget_userns+0x20b/0xcd0 fs/super.c:519 #1: 000000004af8c31e (&sb->s_type->i_mutex_key#10){++++}, at: inode_lock include/linux/fs.h:748 [inline] #1: 000000004af8c31e (&sb->s_type->i_mutex_key#10){++++}, at: ext4_orphan_cleanup fs/ext4/super.c:2689 [inline] #1: 000000004af8c31e (&sb->s_type->i_mutex_key#10){++++}, at: ext4_fill_super+0x82a7/0xc850 fs/ext4/super.c:4549 #2: 00000000dd7852f0 (&ei->i_data_sem/2){++++}, at: ext4_truncate+0x746/0x1380 fs/ext4/inode.c:4552 #3: 00000000374b12bd (dquot_srcu){....}, at: i_dquot fs/quota/dquot.c:921 [inline] #3: 00000000374b12bd (dquot_srcu){....}, at: __dquot_free_space+0x19b/0x9c0 fs/quota/dquot.c:1860 stack backtrace: CPU: 0 PID: 32655 Comm: syz-executor.5 Not tainted 4.19.211-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1fc/0x2ef lib/dump_stack.c:118 print_circular_bug.constprop.0.cold+0x2d7/0x41e kernel/locking/lockdep.c:1222 check_prev_add kernel/locking/lockdep.c:1866 [inline] check_prevs_add kernel/locking/lockdep.c:1979 [inline] validate_chain kernel/locking/lockdep.c:2420 [inline] __lock_acquire+0x30c9/0x3ff0 kernel/locking/lockdep.c:3416 lock_acquire+0x170/0x3c0 kernel/locking/lockdep.c:3908 __mutex_lock_common kernel/locking/mutex.c:937 [inline] __mutex_lock+0xd7/0x1190 kernel/locking/mutex.c:1078 dquot_commit+0x4d/0x400 fs/quota/dquot.c:469 ext4_write_dquot+0x1e7/0x280 fs/ext4/super.c:5650 ext4_mark_dquot_dirty+0x111/0x1a0 fs/ext4/super.c:5701 mark_dquot_dirty fs/quota/dquot.c:341 [inline] mark_all_dquot_dirty fs/quota/dquot.c:379 [inline] __dquot_free_space+0x5d4/0x9c0 fs/quota/dquot.c:1887 dquot_free_space_nodirty include/linux/quotaops.h:377 [inline] dquot_free_space include/linux/quotaops.h:382 [inline] dquot_free_block include/linux/quotaops.h:393 [inline] ext4_free_blocks+0x1922/0x2ac0 fs/ext4/mballoc.c:4950 ext4_remove_blocks fs/ext4/extents.c:2584 [inline] ext4_ext_rm_leaf fs/ext4/extents.c:2740 [inline] ext4_ext_remove_space+0x26ef/0x3e80 fs/ext4/extents.c:2973 ext4_ext_truncate+0x1ae/0x200 fs/ext4/extents.c:4670 ext4_truncate+0xe27/0x1380 fs/ext4/inode.c:4557 ext4_orphan_cleanup fs/ext4/super.c:2691 [inline] ext4_fill_super+0x82f7/0xc850 fs/ext4/super.c:4549 mount_bdev+0x2fc/0x3b0 fs/super.c:1158 mount_fs+0xa3/0x310 fs/super.c:1261 vfs_kern_mount.part.0+0x68/0x470 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x115c/0x2f50 fs/namespace.c:2822 ksys_mount+0xcf/0x130 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xba/0x150 fs/namespace.c:3049 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f267f9035fa Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f267de73f88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00000000000004b6 RCX: 00007f267f9035fa RDX: 00000000200004c0 RSI: 00000000200000c0 RDI: 00007f267de73fe0 RBP: 00007f267de74020 R08: 00007f267de74020 R09: 0000000000000047 R10: 0000000000000047 R11: 0000000000000202 R12: 00000000200004c0 R13: 00000000200000c0 R14: 00007f267de73fe0 R15: 0000000020000100 EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue XFS (loop0): Mounting V4 Filesystem XFS (loop0): Ending clean mount XFS (loop0): Unmounting Filesystem EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue XFS (loop0): Mounting V4 Filesystem XFS (loop0): Ending clean mount XFS (loop0): Unmounting Filesystem EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue XFS (loop0): Mounting V4 Filesystem XFS (loop0): Ending clean mount XFS (loop0): Unmounting Filesystem EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue XFS (loop0): Mounting V4 Filesystem XFS (loop0): Ending clean mount ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 XFS (loop0): Unmounting Filesystem EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 65 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 66 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 67 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 68 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 69 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 70 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 71 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 72 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 128 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 256 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 418 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): bad geometry: block count 1024 exceeds size of device (64 blocks) EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up EXT4-fs (loop5): mounting with "discard" option, but the device does not support discard EXT4-fs (loop5): mounted filesystem without journal. Opts: nojournal_checksum,nodelalloc,grpjquota=,oldalloc,discard,bsddf,barrier=0xffffffffffffffff,journal_ioprio=0x0000000000000001,inode_readahead_blks=0x0000000000010000,,errors=continue EXT4-fs (loop5): Ignoring removed oldalloc option EXT4-fs (loop5): orphan cleanup on readonly fs EXT4-fs (loop5): 1 truncate cleaned up