EXT4-fs error (device loop3): ext4_get_first_dir_block:3521: inode #12: block 32: comm syz-executor.3: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=12, rec_len=106, size=2048 fake=1 EXT4-fs error (device loop3): ext4_get_first_dir_block:3524: inode #12: comm syz-executor.3: directory missing '.' ===================================== WARNING: bad unlock balance detected! 6.1.20-syzkaller #0 Not tainted ------------------------------------- syz-executor.3/14861 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.3/14861: #0: ffff0000ccbe0460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:393 #1: ffff00010545c030 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:791 [inline] #1: ffff00010545c030 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xf0/0x18c fs/namei.c:2990 #2: ffff000104375440 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:756 [inline] #2: ffff000104375440 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: vfs_rename+0x604/0xe80 fs/namei.c:4751 stack backtrace: CPU: 1 PID: 14861 Comm: syz-executor.3 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 = 0xffff000104375dd8, owner = 0x0, curr 0xffff0000d2191b40, list empty WARNING: CPU: 1 PID: 14861 at kernel/locking/rwsem.c:1372 __up_write kernel/locking/rwsem.c:1371 [inline] WARNING: CPU: 1 PID: 14861 at kernel/locking/rwsem.c:1372 up_write+0x5c4/0x76c kernel/locking/rwsem.c:1626 Modules linked in: CPU: 1 PID: 14861 Comm: syz-executor.3 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 : ffff80001f317400 x29: ffff80001f317480 x28: ffff700003e62eb4 x27: 1fffe0002086ebc8 x26: dfff800000000000 x25: 1fffe0002086ebbc x24: ffff000104375e30 x23: 0000000000000000 x22: 0000000000000000 x21: ffff0000d2191b40 x20: ffff000104375dd8 x19: ffff000104375dd8 x18: ffff80001f3170c0 x17: 0000000000000000 x16: ffff80001225a41c x15: 0000000000000000 x14: 0000000000000002 x13: 0000000000000001 x12: 0000000000040000 x11: 000000000003ffff x10: ffff800027a39000 x9 : b053da0c2bb78d00 x8 : b053da0c2bb78d00 x7 : 0000000000000001 x6 : 0000000000000001 x5 : ffff80001f316cf8 x4 : ffff800015813880 x3 : ffff800008590318 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 0000000000000000 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: 6247 hardirqs last enabled at (6247): [] call_rcu+0x614/0xa40 kernel/rcu/tree.c:2833 hardirqs last disabled at (6246): [] call_rcu+0x530/0xa40 kernel/rcu/tree.c:2799 softirqs last enabled at (6090): [] softirq_handle_end kernel/softirq.c:414 [inline] softirqs last enabled at (6090): [] __do_softirq+0xd88/0xff4 kernel/softirq.c:600 softirqs last disabled at (6065): [] ____do_softirq+0x14/0x20 arch/arm64/kernel/irq.c:79 ---[ end trace 0000000000000000 ]---