loop0: detected capacity change from 0 to 512 EXT4-fs: Ignoring removed bh option EXT4-fs (loop0): mounting ext3 file system using the ext4 subsystem EXT4-fs (loop0): 1 truncate cleaned up EXT4-fs (loop0): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none. ================================================================== BUG: KASAN: slab-use-after-free in ext4_search_dir+0xfb/0x1b0 fs/ext4/namei.c:1543 Read of size 1 at addr ffff88810d47ed23 by task syz-executor.0/385 CPU: 1 PID: 385 Comm: syz-executor.0 Not tainted 6.7.0-rc1-syzkaller-00125-g7475e51b8796 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x155/0x1c0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0x15d/0x540 mm/kasan/report.c:475 kasan_report+0x14e/0x180 mm/kasan/report.c:588 __asan_report_load1_noabort+0x18/0x20 mm/kasan/report_generic.c:378 ext4_search_dir+0xfb/0x1b0 fs/ext4/namei.c:1543 ext4_find_inline_entry+0x4ba/0x5e0 fs/ext4/inline.c:1694 __ext4_find_entry+0x2b4/0x1b00 fs/ext4/namei.c:1616 ext4_lookup_entry fs/ext4/namei.c:1771 [inline] ext4_lookup+0x17a/0x750 fs/ext4/namei.c:1839 lookup_one_qstr_excl+0x147/0x290 fs/namei.c:1609 filename_create+0x292/0x530 fs/namei.c:3876 do_mkdirat+0xc2/0x310 fs/namei.c:4121 __do_sys_mkdirat fs/namei.c:4144 [inline] __se_sys_mkdirat fs/namei.c:4142 [inline] __x64_sys_mkdirat+0x8d/0xa0 fs/namei.c:4142 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0xe0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f933307cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 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:00007f9333e950c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f933319bf80 RCX: 00007f933307cae9 RDX: 0000000000000000 RSI: 0000000020000040 RDI: ffffffffffffff9c RBP: 00007f93330c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f933319bf80 R15: 00007ffe3e029e98 Allocated by task 343: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x23/0x30 mm/kasan/generic.c:511 __kasan_slab_alloc+0x6d/0x80 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook+0x68/0x2f0 mm/slab.h:763 slab_alloc_node mm/slub.c:3478 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x184/0x2f0 mm/slub.c:3502 getname_flags+0xbe/0x500 fs/namei.c:140 user_path_at_empty+0x35/0x70 fs/namei.c:2910 user_path_at include/linux/namei.h:57 [inline] ksys_umount fs/namespace.c:1916 [inline] __do_sys_umount fs/namespace.c:1924 [inline] __se_sys_umount fs/namespace.c:1922 [inline] __x64_sys_umount+0xf4/0x170 fs/namespace.c:1922 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0xe0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 343: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4f/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2c/0x50 mm/kasan/generic.c:522 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:236 __kasan_slab_free+0x15/0x20 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:164 [inline] slab_free_hook mm/slub.c:1800 [inline] slab_free_freelist_hook mm/slub.c:1826 [inline] slab_free mm/slub.c:3809 [inline] kmem_cache_free+0x299/0x520 mm/slub.c:3831 putname+0x11b/0x150 fs/namei.c:274 user_path_at_empty+0x58/0x70 fs/namei.c:2913 user_path_at include/linux/namei.h:57 [inline] ksys_umount fs/namespace.c:1916 [inline] __do_sys_umount fs/namespace.c:1924 [inline] __se_sys_umount fs/namespace.c:1922 [inline] __x64_sys_umount+0xf4/0x170 fs/namespace.c:1922 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0xe0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff88810d47e600 which belongs to the cache names_cache of size 4096 The buggy address is located 1827 bytes inside of freed 4096-byte region [ffff88810d47e600, ffff88810d47f600) The buggy address belongs to the physical page: page:ffffea0004351e00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10d478 head:ffffea0004351e00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4000000000000840(slab|head|zone=1) page_type: 0xffffffff() raw: 4000000000000840 ffff888100176780 dead000000000100 dead000000000122 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 1, tgid 1 (init), ts 3023741316, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x223/0x230 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1544 [inline] get_page_from_freelist+0x35b8/0x3680 mm/page_alloc.c:3312 __alloc_pages+0x3e7/0x890 mm/page_alloc.c:4568 allocate_slab mm/slub.c:2017 [inline] new_slab+0xce/0x4d0 mm/slub.c:2070 ___slab_alloc+0x789/0xc50 mm/slub.c:3223 __slab_alloc mm/slub.c:3322 [inline] __slab_alloc_node mm/slub.c:3375 [inline] slab_alloc_node mm/slub.c:3468 [inline] slab_alloc mm/slub.c:3486 [inline] __kmem_cache_alloc_lru mm/slub.c:3493 [inline] kmem_cache_alloc+0x1d2/0x2f0 mm/slub.c:3502 getname_flags+0xbe/0x500 fs/namei.c:140 user_path_at_empty+0x35/0x70 fs/namei.c:2910 user_path_at include/linux/namei.h:57 [inline] do_faccessat+0x5ba/0xb50 fs/open.c:483 __do_sys_access fs/open.c:542 [inline] __se_sys_access fs/open.c:540 [inline] __x64_sys_access+0x65/0x70 fs/open.c:540 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x44/0xe0 arch/x86/entry/common.c:82 entry_SYSCALL_64_after_hwframe+0x63/0x6b page_owner free stack trace missing Memory state around the buggy address: ffff88810d47ec00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810d47ec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810d47ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810d47ed80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810d47ee00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop0): ext4_find_dest_de:2112: inode #12: block 7: comm syz-executor.0: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=3089191003, rec_len=43069, size=56 fake=0