EXT4-fs error (device loop1): ext4_find_dest_de:2063: inode #12: block 7: comm syz-executor.1: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=1660078826, rec_len=60141, size=56 fake=0 EXT4-fs error (device loop1): ext4_xattr_block_get:544: inode #19: comm syz-executor.1: corrupted xattr block 128 ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xee/0x1b0 fs/ext4/namei.c:1504 Read of size 1 at addr ffff8881ef07900a by task syz-executor.1/419 CPU: 0 PID: 419 Comm: syz-executor.1 Not tainted 5.4.268-syzkaller-00001-g8322246edffa #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 ext4_search_dir+0xee/0x1b0 fs/ext4/namei.c:1504 ext4_find_inline_entry+0x4b6/0x5e0 fs/ext4/inline.c:1698 __ext4_find_entry+0x2a9/0x1b50 fs/ext4/namei.c:1577 ext4_lookup_entry fs/ext4/namei.c:1730 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1798 lookup_open fs/namei.c:3308 [inline] do_last fs/namei.c:3421 [inline] path_openat+0x159a/0x3480 fs/namei.c:3634 do_filp_open+0x20b/0x450 fs/namei.c:3664 do_sys_open+0x39c/0x810 fs/open.c:1113 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Allocated by task 370: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 vm_area_dup kernel/fork.c:358 [inline] dup_mmap kernel/fork.c:548 [inline] dup_mm kernel/fork.c:1379 [inline] copy_mm+0x75e/0x10d0 kernel/fork.c:1435 copy_process+0x1291/0x3230 kernel/fork.c:2052 _do_fork+0x197/0x900 kernel/fork.c:2399 __do_sys_clone kernel/fork.c:2557 [inline] __se_sys_clone kernel/fork.c:2538 [inline] __x64_sys_clone+0x26b/0x2c0 kernel/fork.c:2538 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 405: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x1b5/0x270 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kmem_cache_free+0x10b/0x2c0 mm/slub.c:3096 remove_vma mm/mmap.c:182 [inline] exit_mmap+0x415/0x520 mm/mmap.c:3202 __mmput+0x8e/0x2c0 kernel/fork.c:1101 exit_mm kernel/exit.c:536 [inline] do_exit+0xc08/0x2bc0 kernel/exit.c:846 do_group_exit+0x138/0x300 kernel/exit.c:982 get_signal+0xdb1/0x1440 kernel/signal.c:2735 do_signal+0xb0/0x11f0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xc0/0x1a0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the object at ffff8881ef079000 which belongs to the cache vm_area_struct of size 232 The buggy address is located 10 bytes inside of 232-byte region [ffff8881ef079000, ffff8881ef0790e8) The buggy address belongs to the page: page:ffffea0007bc1e40 refcount:1 mapcount:0 mapping:ffff8881f5cfaa00 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f5cfaa00 raw: 0000000000000000 00000000000d000d 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0x109/0x250 mm/slub.c:2842 vm_area_dup kernel/fork.c:358 [inline] dup_mmap kernel/fork.c:548 [inline] dup_mm kernel/fork.c:1379 [inline] copy_mm+0x75e/0x10d0 kernel/fork.c:1435 copy_process+0x1291/0x3230 kernel/fork.c:2052 _do_fork+0x197/0x900 kernel/fork.c:2399 __do_sys_clone kernel/fork.c:2557 [inline] __se_sys_clone kernel/fork.c:2538 [inline] __x64_sys_clone+0x26b/0x2c0 kernel/fork.c:2538 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4951 [inline] __free_pages mm/page_alloc.c:4959 [inline] free_pages+0x114/0x1b0 mm/page_alloc.c:4967 selinux_genfs_get_sid+0x217/0x260 security/selinux/hooks.c:1376 inode_doinit_with_dentry+0x892/0x1050 security/selinux/hooks.c:1571 security_d_instantiate+0x97/0xf0 security/security.c:1896 d_splice_alias+0x6b/0x3b0 fs/dcache.c:3010 kernfs_iop_lookup+0x17c/0x200 fs/kernfs/dir.c:1111 __lookup_slow+0x306/0x460 fs/namei.c:1748 lookup_slow+0x53/0x70 fs/namei.c:1765 walk_component+0x2dc/0x590 fs/namei.c:1885 lookup_last fs/namei.c:2348 [inline] path_lookupat+0x182/0x3f0 fs/namei.c:2393 filename_lookup+0x253/0x6e0 fs/namei.c:2423 do_readlinkat+0x114/0x3a0 fs/stat.c:398 __do_sys_readlink fs/stat.c:431 [inline] __se_sys_readlink fs/stat.c:428 [inline] __x64_sys_readlink+0x7b/0x90 fs/stat.c:428 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881ef078f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881ef078f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881ef079000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881ef079080: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff8881ef079100: fc fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb ================================================================== EXT4-fs error (device loop1): ext4_find_dest_de:2063: inode #12: block 7: comm syz-executor.1: bad entry in directory: rec_len % 4 != 0 - offset=0, inode=1660078826, rec_len=60141, size=56 fake=0