===================================== WARNING: bad unlock balance detected! 6.1.20-syzkaller #0 Not tainted ------------------------------------- syz-executor.2/6254 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: 3 locks held by syz-executor.2/6254: #0: ffff0000d1e1c460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #1: ffff00011c7f5e48 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #1: ffff00011c7f5e48 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xf0/0x18c fs/namei.c:2990 #2: ffff00011c7f6850 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #2: ffff00011c7f6850 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: vfs_rename+0x604/0xe80 fs/namei.c:4751 stack backtrace: CPU: 1 PID: 6254 Comm: syz-executor.2 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 = 0xffff00011c7f0d98, owner = 0x0, curr 0xffff0000c85a51c0, list empty WARNING: CPU: 1 PID: 6254 at kernel/locking/rwsem.c:1372 __up_write kernel/locking/rwsem.c:1371 [inline] WARNING: CPU: 1 PID: 6254 at kernel/locking/rwsem.c:1372 up_write+0x5c4/0x76c kernel/locking/rwsem.c:1626 Modules linked in: CPU: 1 PID: 6254 Comm: syz-executor.2 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 : ffff80001ecf7400 x29: ffff80001ecf7480 x28: ffff700003d9eeb4 x27: 1fffe000238fe1c0 x26: dfff800000000000 x25: 1fffe000238fe1b4 x24: ffff00011c7f0df0 x23: 0000000000000000 x22: 0000000000000000 x21: ffff0000c85a51c0 x20: ffff00011c7f0d98 x19: ffff00011c7f0d98 x18: 1fffe000368b3d76 x17: ffff80001572d000 x16: ffff800012258f5c x15: ffff0001b459ebbc x14: ffff0001b459ebb8 x13: 1fffe000368b3d76 x12: 0000000000000001 x11: ff80800008050a04 x10: 0000000040000002 x9 : 1d02a0a6c5e46c00 x8 : 1d02a0a6c5e46c00 x7 : 1fffe000368b3d77 x6 : ffff800008281b70 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : ffff80001ecf6f60 x1 : 0000000000000000 x0 : ffff800008281c10 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: 799 hardirqs last enabled at (799): [] call_rcu+0x614/0xa40 kernel/rcu/tree.c:2833 hardirqs last disabled at (798): [] call_rcu+0x530/0xa40 kernel/rcu/tree.c:2799 softirqs last enabled at (536): [] softirq_handle_end kernel/softirq.c:414 [inline] softirqs last enabled at (536): [] __do_softirq+0xd88/0xff4 kernel/softirq.c:600 softirqs last disabled at (451): [] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79 ---[ end trace 0000000000000000 ]---