===================================== WARNING: bad unlock balance detected! 6.1.20-syzkaller #0 Not tainted ------------------------------------- syz-executor.2/21342 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.2/21342: #0: ffff0000c9006460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #1: ffff00011cd6e850 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #1: ffff00011cd6e850 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xf0/0x18c fs/namei.c:2990 stack backtrace: CPU: 1 PID: 21342 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 = 0xffff0001276935b8, owner = 0x0, curr 0xffff0001267d51c0, list empty WARNING: CPU: 1 PID: 21342 at kernel/locking/rwsem.c:1372 __up_write kernel/locking/rwsem.c:1371 [inline] WARNING: CPU: 1 PID: 21342 at kernel/locking/rwsem.c:1372 up_write+0x5c4/0x76c kernel/locking/rwsem.c:1626 Modules linked in: CPU: 1 PID: 21342 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 : ffff800021d37400 x29: ffff800021d37480 x28: ffff7000043a6eb4 x27: 1fffe00024ed26c4 x26: dfff800000000000 x25: 1fffe00024ed26b8 x24: ffff000127693610 x23: 0000000000000000 x22: 0000000000000000 x21: ffff0001267d51c0 x20: ffff0001276935b8 x19: ffff0001276935b8 x18: 1fffe000368b3d76 x17: ffff80001572d000 x16: ffff800012258f5c x15: ffff0001b459ebbc x14: ffff0001b459ebb8 x13: 1fffe000368b3d76 x12: 0000000000000001 x11: ff80800008050a04 x10: 0000000040000002 x9 : c9c1c245b26c7000 x8 : c9c1c245b26c7000 x7 : 1fffe000368b3d77 x6 : ffff800008281b70 x5 : 0000000000000000 x4 : 0000000000000001 x3 : 0000000000000000 x2 : ffff800021d36f60 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: 4821 hardirqs last enabled at (4821): [] raw_spin_rq_unlock_irq kernel/sched/sched.h:1366 [inline] hardirqs last enabled at (4821): [] finish_lock_switch+0xbc/0x1e8 kernel/sched/core.c:4997 hardirqs last disabled at (4820): [] __schedule+0x2a8/0x1d84 kernel/sched/core.c:6450 softirqs last enabled at (4818): [] softirq_handle_end kernel/softirq.c:414 [inline] softirqs last enabled at (4818): [] __do_softirq+0xd88/0xff4 kernel/softirq.c:600 softirqs last disabled at (4807): [] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79 ---[ end trace 0000000000000000 ]---