EXT4-fs error (device loop3): ext4_get_first_dir_block:3535: 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:3538: inode #12: comm syz-executor.3: directory missing '.' ===================================== WARNING: bad unlock balance detected! 5.15.103-syzkaller #0 Not tainted ------------------------------------- syz-executor.3/5200 is trying to release lock (&type->i_mutex_dir_key) at: [] inode_unlock include/linux/fs.h:792 [inline] [] ext4_rename fs/ext4/namei.c:4036 [inline] [] ext4_rename2+0x2e18/0x3440 fs/ext4/namei.c:4209 but there are no more locks to release! other info that might help us debug this: 3 locks held by syz-executor.3/5200: #0: ffff0000d7658460 (sb_writers#3){.+.+}-{0:0}, at: mnt_want_write+0x44/0x9c fs/namespace.c:377 #1: ffff000118ec17e0 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:822 [inline] #1: ffff000118ec17e0 (&type->i_mutex_dir_key#3/1){+.+.}-{3:3}, at: lock_rename+0xf0/0x18c fs/namei.c:2967 #2: ffff000118ec3fc0 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: inode_lock include/linux/fs.h:787 [inline] #2: ffff000118ec3fc0 (&type->i_mutex_dir_key#3){++++}-{3:3}, at: vfs_rename+0x604/0xe80 fs/namei.c:4708 stack backtrace: CPU: 1 PID: 5200 Comm: syz-executor.3 Not tainted 5.15.103-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/02/2023 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 dump_stack+0x1c/0x58 lib/dump_stack.c:113 print_unlock_imbalance_bug+0x250/0x2a4 kernel/locking/lockdep.c:5064 lock_release+0x56c/0xb30 kernel/locking/lockdep.c:5642 up_write+0x98/0x438 kernel/locking/rwsem.c:1593 inode_unlock include/linux/fs.h:792 [inline] ext4_rename fs/ext4/namei.c:4036 [inline] ext4_rename2+0x2e18/0x3440 fs/ext4/namei.c:4209 vfs_rename+0x9e0/0xe80 fs/namei.c:4736 do_renameat2+0x980/0x1040 fs/namei.c:4887 __do_sys_renameat2 fs/namei.c:4920 [inline] __se_sys_renameat2 fs/namei.c:4917 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:4917 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 ------------[ cut here ]------------ DEBUG_RWSEMS_WARN_ON((rwsem_owner(sem) != current) && !rwsem_test_oflags(sem, RWSEM_NONSPINNABLE)): count = 0x0, magic = 0xffff000118ec4948, owner = 0x0, curr 0xffff0000d2c79ac0, list empty WARNING: CPU: 0 PID: 5200 at kernel/locking/rwsem.c:1342 __up_write kernel/locking/rwsem.c:1341 [inline] WARNING: CPU: 0 PID: 5200 at kernel/locking/rwsem.c:1342 up_write+0x384/0x438 kernel/locking/rwsem.c:1594 Modules linked in: CPU: 0 PID: 5200 Comm: syz-executor.3 Not tainted 5.15.103-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:1341 [inline] pc : up_write+0x384/0x438 kernel/locking/rwsem.c:1594 lr : __up_write kernel/locking/rwsem.c:1341 [inline] lr : up_write+0x384/0x438 kernel/locking/rwsem.c:1594 sp : ffff80001d2274e0 x29: ffff80001d2274f0 x28: ffff80001d227650 x27: dfff800000000000 x26: dfff800000000000 x25: 1fffe000231d8936 x24: ffff000118ec49a0 x23: 0000000000000000 x22: 0000000000000000 x21: ffff0000d2c79ac0 x20: ffff000118ec4948 x19: ffff000118ec4948 x18: 1fffe000368fc58e x17: 1fffe000368fc58e x16: ffff800011a05534 x15: ffff800014a5f960 x14: ffff0001b47e2c80 x13: ffffffffffffffff x12: 0000000000040000 x11: 000000000003ffff x10: ffff8000216ec000 x9 : ca906e9e5064ba00 x8 : ca906e9e5064ba00 x7 : 0000000000000000 x6 : ffff80000826caac x5 : 0000000000000000 x4 : 0000000000000000 x3 : ffff8000085517f0 x2 : 0000000000000001 x1 : 0000000100000000 x0 : 00000000000000bd Call trace: __up_write kernel/locking/rwsem.c:1341 [inline] up_write+0x384/0x438 kernel/locking/rwsem.c:1594 inode_unlock include/linux/fs.h:792 [inline] ext4_rename fs/ext4/namei.c:4036 [inline] ext4_rename2+0x2e18/0x3440 fs/ext4/namei.c:4209 vfs_rename+0x9e0/0xe80 fs/namei.c:4736 do_renameat2+0x980/0x1040 fs/namei.c:4887 __do_sys_renameat2 fs/namei.c:4920 [inline] __se_sys_renameat2 fs/namei.c:4917 [inline] __arm64_sys_renameat2+0xe0/0xfc fs/namei.c:4917 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:596 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:614 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 irq event stamp: 879 hardirqs last enabled at (879): [] __call_rcu kernel/rcu/tree.c:3027 [inline] hardirqs last enabled at (879): [] call_rcu+0x644/0xb40 kernel/rcu/tree.c:3073 hardirqs last disabled at (878): [] __call_rcu kernel/rcu/tree.c:2992 [inline] hardirqs last disabled at (878): [] call_rcu+0x558/0xb40 kernel/rcu/tree.c:3073 softirqs last enabled at (844): [] softirq_handle_end kernel/softirq.c:401 [inline] softirqs last enabled at (844): [] __do_softirq+0xcc4/0xf60 kernel/softirq.c:587 softirqs last disabled at (731): [] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline] softirqs last disabled at (731): [] invoke_softirq kernel/softirq.c:439 [inline] softirqs last disabled at (731): [] __irq_exit_rcu+0x28c/0x534 kernel/softirq.c:636 ---[ end trace c4fd71752600f705 ]---