===================================== WARNING: bad unlock balance detected! 6.1.20-syzkaller #0 Not tainted ------------------------------------- syz-executor.4/32146 is trying to release lock (&type->i_mutex_dir_key) at: [] inode_unlock include/linux/fs.h:761 [inline] [] ext4_rename fs/ext4/namei.c:4029 [inline] [] ext4_rename2+0x2d24/0x32dc fs/ext4/namei.c:4202 but there are no more locks to release! other info that might help us debug this: 2 locks held by syz-executor.4/32146: #0: ffff0000fc162460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #1: ffff00012c25e850 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #1: ffff00012c25e850 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xf0/0x18c fs/namei.c:2990 stack backtrace: CPU: 0 PID: 32146 Comm: syz-executor.4 Not tainted 6.1.20-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 print_unlock_imbalance_bug+0x250/0x2a4 kernel/locking/lockdep.c:5109 lock_release+0x5b8/0xb8c kernel/locking/lockdep.c:5689 up_write+0x94/0x76c kernel/locking/rwsem.c:1625 inode_unlock include/linux/fs.h:761 [inline] ext4_rename fs/ext4/namei.c:4029 [inline] ext4_rename2+0x2d24/0x32dc fs/ext4/namei.c:4202 vfs_rename+0x9e0/0xe80 fs/namei.c:4779 do_renameat2+0x980/0x1040 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:4960 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 ------------[ cut here ]------------ DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff00012c368390, owner = 0x0, curr 0xffff0000d428b680, list empty WARNING: CPU: 0 PID: 32146 at kernel/locking/rwsem.c:1372 __up_write kernel/locking/rwsem.c:1371 [inline] WARNING: CPU: 0 PID: 32146 at kernel/locking/rwsem.c:1372 up_write+0x5c4/0x76c kernel/locking/rwsem.c:1626 Modules linked in: CPU: 0 PID: 32146 Comm: syz-executor.4 Not tainted 6.1.20-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : __up_write kernel/locking/rwsem.c:1371 [inline] pc : up_write+0x5c4/0x76c kernel/locking/rwsem.c:1626 lr : __up_write kernel/locking/rwsem.c:1371 [inline] lr : up_write+0x5c4/0x76c kernel/locking/rwsem.c:1626 sp : ffff80001fa67400 x29: ffff80001fa67480 x28: ffff700003f4ceb4 x27: 1fffe0002586d07f x26: dfff800000000000 x25: 1fffe0002586d073 x24: ffff00012c3683e8 x23: 0000000000000000 x22: 0000000000000000 x21: ffff0000d428b680 x20: ffff00012c368390 x19: ffff00012c368390 x18: 1fffe000368afd76 x17: ffff80001572d000 x16: ffff800012258f5c x15: ffff0001b457ebbc x14: ffff0001b457ebb8 x13: 1fffe000368afd76 x12: 0000000000000001 x11: 1fffe0001ba68cd0 x10: 0000000000000000 x9 : 020309e2b6cd9100 x8 : 020309e2b6cd9100 x7 : 1fffe000368afd77 x6 : ffff800008281b70 x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80000826f27c x2 : 0000000000000001 x1 : 0000000000000004 x0 : 0000000000000001 Call trace: __up_write kernel/locking/rwsem.c:1371 [inline] up_write+0x5c4/0x76c kernel/locking/rwsem.c:1626 inode_unlock include/linux/fs.h:761 [inline] ext4_rename fs/ext4/namei.c:4029 [inline] ext4_rename2+0x2d24/0x32dc fs/ext4/namei.c:4202 vfs_rename+0x9e0/0xe80 fs/namei.c:4779 do_renameat2+0x980/0x1040 fs/namei.c:4930 __do_sys_renameat2 fs/namei.c:4963 [inline] __se_sys_renameat2 fs/namei.c:4960 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:4960 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 irq event stamp: 4967 hardirqs last enabled at (4967): [] lookup_bh_lru fs/buffer.c:1291 [inline] hardirqs last enabled at (4967): [] __find_get_block+0x1d0/0xeec fs/buffer.c:1303 hardirqs last disabled at (4966): [] lookup_bh_lru fs/buffer.c:1272 [inline] hardirqs last disabled at (4966): [] __find_get_block+0xa0/0xeec fs/buffer.c:1303 softirqs last enabled at (4816): [] local_bh_enable+0x10/0x34 include/linux/bottom_half.h:32 softirqs last disabled at (4814): [] local_bh_disable+0x10/0x34 include/linux/bottom_half.h:19 ---[ end trace 0000000000000000 ]---