====================================================== WARNING: possible circular locking dependency detected 4.19.211-syzkaller #0 Not tainted ------------------------------------------------------ syz-executor.3/19477 is trying to acquire lock: 0000000012a0f7f5 (&dquot->dq_lock){+.+.}, at: dquot_commit+0x4d/0x400 fs/quota/dquot.c:469 but task is already holding lock: 0000000078da977b (&ei->i_data_sem/2){++++}, at: ext4_map_blocks+0x740/0x1a50 fs/ext4/inode.c:650 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+0x3f9/0x4f0 fs/ext4/inode.c:993 ext4_bread+0x7c/0x210 fs/ext4/inode.c:1043 ext4_quota_read+0x216/0x2e0 fs/ext4/super.c:5962 find_tree_dqentry+0x77/0x700 fs/quota/quota_tree.c:579 find_tree_dqentry+0x200/0x700 fs/quota/quota_tree.c:590 find_tree_dqentry+0x200/0x700 fs/quota/quota_tree.c:590 find_tree_dqentry+0x200/0x700 fs/quota/quota_tree.c:590 find_dqentry fs/quota/quota_tree.c:602 [inline] qtree_read_dquot+0x107/0x700 fs/quota/quota_tree.c:622 v2_read_dquot+0xce/0x120 fs/quota/quota_v2.c:334 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_orphan_cleanup fs/ext4/super.c:2681 [inline] ext4_fill_super+0x8202/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 -> #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_alloc_space+0x37e/0x860 fs/quota/dquot.c:1702 dquot_alloc_space_nodirty include/linux/quotaops.h:298 [inline] dquot_alloc_space include/linux/quotaops.h:311 [inline] dquot_alloc_block include/linux/quotaops.h:335 [inline] ext4_mb_new_blocks+0x58c/0x4370 fs/ext4/mballoc.c:4534 ext4_ext_map_blocks+0x2aa2/0x7390 fs/ext4/extents.c:4493 ext4_map_blocks+0x7a2/0x1a50 fs/ext4/inode.c:657 ext4_getblk+0xad/0x4f0 fs/ext4/inode.c:993 ext4_bread+0x7c/0x210 fs/ext4/inode.c:1043 ext4_append+0x155/0x370 fs/ext4/namei.c:66 ext4_init_new_dir fs/ext4/namei.c:2659 [inline] ext4_mkdir+0x5bd/0xe10 fs/ext4/namei.c:2706 vfs_mkdir+0x508/0x7a0 fs/namei.c:3819 do_mkdirat+0x262/0x2d0 fs/namei.c:3842 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.3/19477: #0: 000000000ebfda79 (sb_writers#3){.+.+}, at: sb_start_write include/linux/fs.h:1579 [inline] #0: 000000000ebfda79 (sb_writers#3){.+.+}, at: mnt_want_write+0x3a/0xb0 fs/namespace.c:360 #1: 00000000ecaa019e (&type->i_mutex_dir_key#3/1){+.+.}, at: inode_lock_nested include/linux/fs.h:783 [inline] #1: 00000000ecaa019e (&type->i_mutex_dir_key#3/1){+.+.}, at: filename_create+0x15a/0x490 fs/namei.c:3638 #2: 0000000078da977b (&ei->i_data_sem/2){++++}, at: ext4_map_blocks+0x740/0x1a50 fs/ext4/inode.c:650 #3: 00000000b50107e3 (dquot_srcu){....}, at: i_dquot fs/quota/dquot.c:921 [inline] #3: 00000000b50107e3 (dquot_srcu){....}, at: __dquot_alloc_space+0x1ad/0x860 fs/quota/dquot.c:1662 stack backtrace: CPU: 1 PID: 19477 Comm: syz-executor.3 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_alloc_space+0x37e/0x860 fs/quota/dquot.c:1702 dquot_alloc_space_nodirty include/linux/quotaops.h:298 [inline] dquot_alloc_space include/linux/quotaops.h:311 [inline] dquot_alloc_block include/linux/quotaops.h:335 [inline] ext4_mb_new_blocks+0x58c/0x4370 fs/ext4/mballoc.c:4534 ext4_ext_map_blocks+0x2aa2/0x7390 fs/ext4/extents.c:4493 ext4_map_blocks+0x7a2/0x1a50 fs/ext4/inode.c:657 ext4_getblk+0xad/0x4f0 fs/ext4/inode.c:993 ext4_bread+0x7c/0x210 fs/ext4/inode.c:1043 ext4_append+0x155/0x370 fs/ext4/namei.c:66 ext4_init_new_dir fs/ext4/namei.c:2659 [inline] ext4_mkdir+0x5bd/0xe10 fs/ext4/namei.c:2706 vfs_mkdir+0x508/0x7a0 fs/namei.c:3819 do_mkdirat+0x262/0x2d0 fs/namei.c:3842 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fbc342bb0c9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007fbc2a3e9168 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007fbc343db2c0 RCX: 00007fbc342bb0c9 RDX: 0000000000000000 RSI: 00000000200000c0 RDI: ffffffffffffff9c RBP: 00007fbc34316ae9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffff428070f R14: 00007fbc2a3e9300 R15: 0000000000022000 audit: type=1804 audit(1673254214.925:107): pid=19495 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir2988498321/syzkaller.Tg0sFW/173/file0/bus" dev="ramfs" ino=54806 res=1 audit: type=1804 audit(1673254214.985:108): pid=19501 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.2" name="/root/syzkaller-testdir2988498321/syzkaller.Tg0sFW/173/file0/bus" dev="ramfs" ino=54806 res=1 audit: type=1804 audit(1673254215.835:109): pid=19571 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.2" name="/root/syzkaller-testdir2988498321/syzkaller.Tg0sFW/174/file0/bus" dev="ramfs" ino=53920 res=1 audit: type=1804 audit(1673254215.885:110): pid=19571 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.2" name="/root/syzkaller-testdir2988498321/syzkaller.Tg0sFW/174/file0/bus" dev="ramfs" ino=53920 res=1 overlayfs: unrecognized mount option "lowErdir=.:file0" or missing value hub 9-0:1.0: USB hub found hub 9-0:1.0: 8 ports detected EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.5'. hub 9-0:1.0: USB hub found hub 9-0:1.0: 8 ports detected netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 12 bytes leftover after parsing attributes in process `syz-executor.5'. netlink: 8 bytes leftover after parsing attributes in process `syz-executor.5'. hub 9-0:1.0: USB hub found netlink: 12 bytes leftover after parsing attributes in process `syz-executor.5'. hub 9-0:1.0: 8 ports detected EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue device geneve2 entered promiscuous mode EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue device geneve2 entered promiscuous mode device geneve2 entered promiscuous mode audit: type=1804 audit(1673254221.355:111): pid=20053 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2926171220/syzkaller.0DMUV0/37/bus" dev="sda1" ino=14791 res=1 audit: type=1804 audit(1673254221.525:112): pid=20053 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2926171220/syzkaller.0DMUV0/37/bus" dev="sda1" ino=14791 res=1 ntfs: (device loop3): parse_options(): Unrecognized mount option audit. ntfs: (device loop3): parse_options(): Unrecognized mount option app. audit: type=1804 audit(1673254221.675:113): pid=20103 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=ToMToU comm="syz-executor.0" name="/root/syzkaller-testdir2926171220/syzkaller.0DMUV0/37/bus" dev="sda1" ino=14791 res=1 EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue ntfs: (device loop3): parse_options(): Unrecognized mount option audit. ntfs: (device loop3): parse_options(): Unrecognized mount option app. audit: type=1804 audit(1673254222.546:114): pid=20172 uid=0 auid=4294967295 ses=4294967295 subj==unconfined op=invalid_pcr cause=open_writers comm="syz-executor.0" name="/root/syzkaller-testdir2926171220/syzkaller.0DMUV0/39/bus" dev="sda1" ino=14798 res=1 ntfs: (device loop3): parse_options(): Unrecognized mount option audit. ntfs: (device loop3): parse_options(): Unrecognized mount option app. EXT4-fs (loop4): mounted filesystem without journal. Opts: ,errors=continue ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22