================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 Read of size 1 at addr ffff88810d2a0900 by task syz-executor396/307 CPU: 0 PID: 307 Comm: syz-executor396 Not tainted 5.10.226-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report_generic.c:306 ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1700 __ext4_find_entry+0x2b0/0x1990 fs/ext4/namei.c:1589 ext4_lookup_entry fs/ext4/namei.c:1744 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1812 __lookup_hash+0x143/0x290 fs/namei.c:1541 filename_create+0x202/0x750 fs/namei.c:3608 user_path_create fs/namei.c:3665 [inline] do_mknodat+0x187/0x450 fs/namei.c:3729 __do_sys_mknod fs/namei.c:3768 [inline] __se_sys_mknod fs/namei.c:3766 [inline] __x64_sys_mknod+0x80/0x90 fs/namei.c:3766 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f32979e1b89 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 18 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f329799d168 EFLAGS: 00000246 ORIG_RAX: 0000000000000085 RAX: ffffffffffffffda RBX: 00007f3297a6b6c8 RCX: 00007f32979e1b89 RDX: 0000000000000707 RSI: 0000000000000000 RDI: 0000000020000000 RBP: 00007f3297a6b6c0 R08: 00007f329799d6c0 R09: 0000000000000000 R10: 0000000000001501 R11: 0000000000000246 R12: 00007f3297a6b6cc R13: 0000000000000006 R14: 00007fffd657f730 R15: 00007fffd657f818 Allocated by task 1: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:463 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 getname_flags+0xba/0x520 fs/namei.c:141 user_path_at_empty+0x2d/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] do_faccessat+0x39f/0x810 fs/open.c:424 __do_sys_access fs/open.c:483 [inline] __se_sys_access fs/open.c:481 [inline] __x64_sys_access+0x61/0x70 fs/open.c:481 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 1: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kmem_cache_free+0xa9/0x1e0 mm/slub.c:3219 putname fs/namei.c:262 [inline] filename_lookup+0x515/0x6f0 fs/namei.c:2470 user_path_at_empty+0x40/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] do_faccessat+0x39f/0x810 fs/open.c:424 __do_sys_access fs/open.c:483 [inline] __se_sys_access fs/open.c:481 [inline] __x64_sys_access+0x61/0x70 fs/open.c:481 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88810d2a0000 which belongs to the cache names_cache of size 4096 The buggy address is located 2304 bytes inside of 4096-byte region [ffff88810d2a0000, ffff88810d2a1000) The buggy address belongs to the page: page:ffffea000434a800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d2a0 head:ffffea000434a800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea000434a400 0000000200000002 ffff888100193080 raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 73, ts 3702849541, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:2960 getname_flags+0xba/0x520 fs/namei.c:141 user_path_at_empty+0x2d/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] vfs_statx+0x106/0x3b0 fs/stat.c:193 vfs_fstatat fs/stat.c:215 [inline] __do_sys_newfstatat fs/stat.c:383 [inline] __se_sys_newfstatat+0xc8/0x760 fs/stat.c:377 __x64_sys_newfstatat+0x9b/0xb0 fs/stat.c:377 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb page_owner free stack trace missing Memory state around the buggy address: ffff88810d2a0800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810d2a0880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810d2a0900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810d2a0980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810d2a0a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop3): ext4_find_dest_de:2077: inode #12: block 7: comm syz-executor396: bad entry in directory: directory entry overrun - offset=0, inode=1793120026, rec_len=34652, size=56 fake=0