EXT4-fs (loop9): mounted filesystem without journal. Opts: noblock_validity,bsddf,sysvgroups,norecovery,debug_want_extra_isize=0x0000000000000080,orlov,nogrpid,noauto_da_alloc,acl,,errors=continue ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 Read of size 1 at addr ffff88813e81c900 by task syz.9.2536/10043 CPU: 0 PID: 10043 Comm: syz.9.2536 Tainted: G W 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_mkdirat+0xcc/0x2c0 fs/namei.c:3805 __do_sys_mkdirat fs/namei.c:3823 [inline] __se_sys_mkdirat fs/namei.c:3821 [inline] __x64_sys_mkdirat+0x7b/0x90 fs/namei.c:3821 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f6390c7cfb7 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 02 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f638f8f6e68 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f638f8f6ef0 RCX: 00007f6390c7cfb7 RDX: 00000000000001ff RSI: 0000000020000080 RDI: 00000000ffffff9c RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000080 R13: 00007f638f8f6eb0 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the page: page:ffffea0004fa0700 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x1 pfn:0x13e81c flags: 0x4000000000000000() raw: 4000000000000000 ffffea0004dcbf08 ffffea0004fd0208 0000000000000000 raw: 0000000000000001 0000000000000001 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x100cca(GFP_HIGHUSER_MOVABLE), pid 9984, ts 405022981061, free_ts 407879086306 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 __alloc_pages include/linux/gfp.h:544 [inline] __alloc_pages_node include/linux/gfp.h:557 [inline] alloc_pages_node include/linux/gfp.h:571 [inline] alloc_pages include/linux/gfp.h:590 [inline] shmem_alloc_page+0x257/0x420 mm/shmem.c:1580 shmem_alloc_and_acct_page+0x395/0x8e0 mm/shmem.c:1605 shmem_getpage_gfp+0x891/0x2480 mm/shmem.c:1918 shmem_fault+0x2d4/0x7b0 mm/shmem.c:2139 __do_fault mm/memory.c:4036 [inline] do_read_fault mm/memory.c:4371 [inline] do_fault mm/memory.c:4499 [inline] handle_pte_fault+0x23a9/0x3e30 mm/memory.c:4763 __handle_mm_fault mm/memory.c:4916 [inline] handle_mm_fault+0x11d6/0x1a10 mm/memory.c:5330 faultin_page mm/gup.c:902 [inline] __get_user_pages+0xb31/0x11b0 mm/gup.c:1121 populate_vma_page_range mm/gup.c:1454 [inline] __mm_populate+0x363/0x520 mm/gup.c:1502 mm_populate include/linux/mm.h:2782 [inline] vm_mmap_pgoff+0x264/0x390 mm/util.c:548 ksys_mmap_pgoff+0xf8/0x1f0 mm/mmap.c:1701 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:95 [inline] __se_sys_mmap arch/x86/kernel/sys_x86_64.c:86 [inline] __x64_sys_mmap+0x103/0x120 arch/x86/kernel/sys_x86_64.c:86 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page_list+0x122/0xb20 mm/page_alloc.c:3443 release_pages+0xea0/0xef0 mm/swap.c:1103 __pagevec_release+0x84/0x100 mm/swap.c:1123 pagevec_release include/linux/pagevec.h:88 [inline] shmem_undo_range+0x7d1/0x1a60 mm/shmem.c:965 shmem_truncate_range mm/shmem.c:1069 [inline] shmem_evict_inode+0x215/0x9d0 mm/shmem.c:1169 evict+0x526/0x9c0 fs/inode.c:612 iput_final fs/inode.c:1732 [inline] iput+0x632/0x7e0 fs/inode.c:1758 dentry_unlink_inode+0x2ea/0x3d0 fs/dcache.c:378 __dentry_kill+0x447/0x650 fs/dcache.c:583 dentry_kill+0xc0/0x2a0 dput+0x40/0x80 fs/dcache.c:883 __fput+0x52e/0x7b0 fs/file_table.c:294 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x129/0x190 kernel/task_work.c:189 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xc83/0x2a50 kernel/exit.c:863 Memory state around the buggy address: ffff88813e81c800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88813e81c880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88813e81c900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88813e81c980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88813e81ca00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop9): ext4_find_dest_de:2077: inode #12: block 7: comm syz.9.2536: bad entry in directory: directory entry overrun - offset=0, inode=1793120026, rec_len=34652, size=56 fake=0