------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in fs/ocfs2/dir.c:840:14 index 40959 is out of range for type 'struct ocfs2_extent_rec[] __counted_by(l_count)' (aka 'struct ocfs2_extent_rec[]') CPU: 0 UID: 0 PID: 5335 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 ubsan_epilogue+0xa/0x30 lib/ubsan.c:233 __ubsan_handle_out_of_bounds+0xe8/0xf0 lib/ubsan.c:455 ocfs2_dx_dir_lookup_rec+0x253/0x710 fs/ocfs2/dir.c:840 ocfs2_dx_dir_lookup+0xdb/0x540 fs/ocfs2/dir.c:896 ocfs2_dx_dir_search fs/ocfs2/dir.c:956 [inline] ocfs2_find_entry_dx fs/ocfs2/dir.c:1070 [inline] ocfs2_find_entry+0x1015/0x21a0 fs/ocfs2/dir.c:1107 ocfs2_find_files_on_disk+0xe0/0x340 fs/ocfs2/dir.c:2030 ocfs2_lookup_ino_from_name+0x52/0x100 fs/ocfs2/dir.c:2052 ocfs2_lookup+0x249/0xa20 fs/ocfs2/namei.c:123 __lookup_slow+0x2b7/0x410 fs/namei.c:1915 lookup_slow+0x53/0x70 fs/namei.c:1932 walk_component fs/namei.c:2278 [inline] lookup_last fs/namei.c:2785 [inline] path_lookupat+0x3f5/0x8c0 fs/namei.c:2809 filename_lookup+0x256/0x5d0 fs/namei.c:2838 kern_path+0x3d/0x150 fs/namei.c:3044 unix_find_bsd net/unix/af_unix.c:1215 [inline] unix_find_other+0x19d/0xb40 net/unix/af_unix.c:1281 unix_dgram_sendmsg+0x754/0x18b0 net/unix/af_unix.c:2162 sock_sendmsg_nosec net/socket.c:787 [inline] __sock_sendmsg net/socket.c:802 [inline] ____sys_sendmsg+0x972/0x9f0 net/socket.c:2698 ___sys_sendmsg+0x2a5/0x360 net/socket.c:2752 __sys_sendmmsg+0x27c/0x4e0 net/socket.c:2841 __do_sys_sendmmsg net/socket.c:2868 [inline] __se_sys_sendmmsg net/socket.c:2865 [inline] __x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2865 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fbfe579ce59 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fbfe65d2fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fbfe5a16090 RCX: 00007fbfe579ce59 RDX: 0000000000000002 RSI: 0000200000000ec0 RDI: 000000000000000b RBP: 00007fbfe5832d6f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fbfe5a16128 R14: 00007fbfe5a16090 R15: 00007ffe2ece9c08 ---[ end trace ]---