====================================================== WARNING: possible circular locking dependency detected 6.4.0-rc1-syzkaller-00012-gb104dbedbe61 #0 Not tainted ------------------------------------------------------ syz-executor.0/20174 is trying to acquire lock: ff600000129e80e0 (&type->s_umount_key#31){++++}-{3:3}, at: __do_sys_quotactl_fd fs/quota/quota.c:999 [inline] ff600000129e80e0 (&type->s_umount_key#31){++++}-{3:3}, at: sys_quotactl_fd+0x282/0x360 fs/quota/quota.c:972 but task is already holding lock: ff600000129e8460 (sb_writers#4){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1494 [inline] ff600000129e8460 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1569 [inline] ff600000129e8460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x2c/0x78 fs/namespace.c:394 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #1 (sb_writers#4){.+.+}-{0:0}: lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x276/0x588 kernel/locking/lockdep.c:5656 percpu_down_read include/linux/percpu-rwsem.h:51 [inline] __sb_start_write include/linux/fs.h:1494 [inline] sb_start_write include/linux/fs.h:1569 [inline] write_mmp_block+0xc8/0x80c fs/ext4/mmp.c:50 ext4_multi_mount_protect+0x3e8/0x75c fs/ext4/mmp.c:347 __ext4_remount fs/ext4/super.c:6578 [inline] ext4_reconfigure+0x15e6/0x168a fs/ext4/super.c:6677 reconfigure_super+0x1c8/0x492 fs/super.c:956 vfs_fsconfig_locked fs/fsopen.c:254 [inline] __do_sys_fsconfig fs/fsopen.c:439 [inline] sys_fsconfig+0x87e/0x93a fs/fsopen.c:314 syscall_handler+0xfa/0x148 arch/riscv/include/asm/syscall.h:90 do_trap_ecall_u+0xea/0xec arch/riscv/kernel/traps.c:279 ret_from_exception+0x0/0x64 arch/riscv/kernel/entry.S:102 -> #0 (&type->s_umount_key#31){++++}-{3:3}: check_noncircular+0x1da/0x1fa kernel/locking/lockdep.c:2188 check_prev_add kernel/locking/lockdep.c:3108 [inline] check_prevs_add kernel/locking/lockdep.c:3227 [inline] validate_chain kernel/locking/lockdep.c:3842 [inline] __lock_acquire+0x19aa/0x34a2 kernel/locking/lockdep.c:5074 lock_acquire kernel/locking/lockdep.c:5691 [inline] lock_acquire+0x276/0x588 kernel/locking/lockdep.c:5656 down_read+0x3c/0x54 kernel/locking/rwsem.c:1520 __do_sys_quotactl_fd fs/quota/quota.c:999 [inline] sys_quotactl_fd+0x282/0x360 fs/quota/quota.c:972 syscall_handler+0xfa/0x148 arch/riscv/include/asm/syscall.h:90 do_trap_ecall_u+0xea/0xec arch/riscv/kernel/traps.c:279 ret_from_exception+0x0/0x64 arch/riscv/kernel/entry.S:102 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- rlock(sb_writers#4); lock(&type->s_umount_key#31); lock(sb_writers#4); rlock(&type->s_umount_key#31); *** DEADLOCK *** 1 lock held by syz-executor.0/20174: #0: ff600000129e8460 (sb_writers#4){.+.+}-{0:0}, at: __sb_start_write include/linux/fs.h:1494 [inline] #0: ff600000129e8460 (sb_writers#4){.+.+}-{0:0}, at: sb_start_write include/linux/fs.h:1569 [inline] #0: ff600000129e8460 (sb_writers#4){.+.+}-{0:0}, at: mnt_want_write+0x2c/0x78 fs/namespace.c:394 stack backtrace: CPU: 0 PID: 20174 Comm: syz-executor.0 Not tainted 6.4.0-rc1-syzkaller-00012-gb104dbedbe61 #0 Hardware name: riscv-virtio,qemu (DT) Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:121 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:127 [] __dump_stack lib/dump_stack.c:88 [inline] [] dump_stack_lvl+0xe0/0x14c lib/dump_stack.c:106 [] dump_stack+0x1c/0x24 lib/dump_stack.c:113 [] print_circular_bug+0x3ae/0x47c kernel/locking/lockdep.c:2066 [] check_noncircular+0x1da/0x1fa kernel/locking/lockdep.c:2188 [] check_prev_add kernel/locking/lockdep.c:3108 [inline] [] check_prevs_add kernel/locking/lockdep.c:3227 [inline] [] validate_chain kernel/locking/lockdep.c:3842 [inline] [] __lock_acquire+0x19aa/0x34a2 kernel/locking/lockdep.c:5074 [] lock_acquire kernel/locking/lockdep.c:5691 [inline] [] lock_acquire+0x276/0x588 kernel/locking/lockdep.c:5656 [] down_read+0x3c/0x54 kernel/locking/rwsem.c:1520 [] __do_sys_quotactl_fd fs/quota/quota.c:999 [inline] [] sys_quotactl_fd+0x282/0x360 fs/quota/quota.c:972 [] syscall_handler+0xfa/0x148 arch/riscv/include/asm/syscall.h:90 [] do_trap_ecall_u+0xea/0xec arch/riscv/kernel/traps.c:279 [] ret_from_exception+0x0/0x64 arch/riscv/kernel/entry.S:102