EXT4-fs (loop0): mounted filesystem without journal. Opts: ,errors=continue ================================================================== BUG: KASAN: use-after-free in ext4_search_dir+0xf7/0x1b0 fs/ext4/namei.c:1516 Read of size 1 at addr ffff88810dbc6d0b by task syz-executor343/281 CPU: 1 PID: 281 Comm: syz-executor343 Not tainted 5.10.226-syzkaller-00709-ge5e5644ea27f #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_slow+0x2b9/0x400 fs/namei.c:1640 lookup_slow+0x5a/0x80 fs/namei.c:1657 walk_component+0x48c/0x610 fs/namei.c:1952 lookup_last fs/namei.c:2403 [inline] path_lookupat+0x16d/0x450 fs/namei.c:2427 filename_lookup+0x26a/0x6f0 fs/namei.c:2460 user_path_at_empty+0x40/0x50 fs/namei.c:2740 user_path_at include/linux/namei.h:60 [inline] do_mount fs/namespace.c:3250 [inline] __do_sys_mount fs/namespace.c:3461 [inline] __se_sys_mount+0x285/0x3b0 fs/namespace.c:3438 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3438 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f6c5e3f4ff9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 61 17 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffe01797a78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007ffe01797b40 RCX: 00007f6c5e3f4ff9 RDX: 0000000000000000 RSI: 0000000020002ac0 RDI: 0000000000000000 RBP: 00007ffe01797b48 R08: 0000000000000000 R09: 00007f6c5e43e150 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe01797de8 R14: 0000000000000001 R15: 0000000000000001 The buggy address belongs to the page: page:ffffea000436f180 refcount:2 mapcount:0 mapping:ffff88810b203bf0 index:0x16 pfn:0x10dbc6 aops:shmem_aops ino:2 dentry name:"messages" flags: 0x400000000008002e(referenced|uptodate|dirty|active|swapbacked) raw: 400000000008002e dead000000000100 dead000000000122 ffff88810b203bf0 raw: 0000000000000016 0000000000000000 00000002ffffffff ffff888100144000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff888100144000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x100cca(GFP_HIGHUSER_MOVABLE), pid 76, ts 20115280481, free_ts 20029059593 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_getpage mm/shmem.c:161 [inline] shmem_write_begin+0xca/0x1b0 mm/shmem.c:2500 generic_perform_write+0x2cd/0x570 mm/filemap.c:3509 __generic_file_write_iter+0x23c/0x560 mm/filemap.c:3638 generic_file_write_iter+0xaf/0x1c0 mm/filemap.c:3670 call_write_iter include/linux/fs.h:2021 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb4c/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 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 do_renameat2+0xadf/0x1240 fs/namei.c:4623 __do_sys_rename fs/namei.c:4670 [inline] __se_sys_rename fs/namei.c:4668 [inline] __x64_sys_rename+0x86/0x90 fs/namei.c:4668 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff88810dbc6c00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88810dbc6c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88810dbc6d00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88810dbc6d80: 00 00 00 00 00 00 0