================================================================== BUG: KASAN: use-after-free in dx_insert_block fs/ext4/namei.c:1358 [inline] BUG: KASAN: use-after-free in do_split+0x1db1/0x2310 fs/ext4/namei.c:2042 Read of size 157024 at addr ffff888125fa1028 by task syz.9.455/1998 CPU: 0 PID: 1998 Comm: syz.9.455 Not tainted 5.10.226-syzkaller-00001-g6a01908517df #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 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 memmove+0x2d/0x70 mm/kasan/shadow.c:54 dx_insert_block fs/ext4/namei.c:1358 [inline] do_split+0x1db1/0x2310 fs/ext4/namei.c:2042 make_indexed_dir+0xe3a/0x1500 fs/ext4/namei.c:2346 ext4_add_entry+0xdcf/0x1280 fs/ext4/namei.c:2458 __ext4_link+0x4e9/0x790 fs/ext4/namei.c:3645 ext4_link+0x1f3/0x290 fs/ext4/namei.c:3686 vfs_link+0x68f/0x890 fs/namei.c:4213 do_linkat+0x471/0x8b0 fs/namei.c:4281 __do_sys_link fs/namei.c:4310 [inline] __se_sys_link fs/namei.c:4308 [inline] __x64_sys_link+0x68/0x80 fs/namei.c:4308 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fa480ecc819 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa48094d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000056 RAX: ffffffffffffffda RBX: 00007fa481083fa0 RCX: 00007fa480ecc819 RDX: 0000000000000000 RSI: 0000000020000bc0 RDI: 0000000020001240 RBP: 00007fa480f3f75e R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fa481083fa0 R15: 00007ffc5390ce28 The buggy address belongs to the page: page:ffffea000497e840 refcount:3 mapcount:1 mapping:ffff888110b42d10 index:0x1 pfn:0x125fa1 aops:def_blk_aops ino:0 flags: 0x400000000032201e(referenced|uptodate|dirty|lru|private|mappedtodisk|unevictable|mlocked) raw: 400000000032201e ffffea0004b2a508 ffffea00042f2c48 ffff888110b42d10 raw: 0000000000000001 ffff888120ac7498 0000000300000000 ffff88812a8c2000 page dumped because: kasan: bad access detected page->mem_cgroup:ffff88812a8c2000 page_owner tracks the page as allocated page last allocated via order 0, migratetype Movable, gfp_mask 0x108c48(GFP_NOFS|__GFP_NOFAIL|__GFP_HARDWALL|__GFP_MOVABLE), pid 1998, ts 168892950265, free_ts 168680155261 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] __page_cache_alloc include/linux/pagemap.h:290 [inline] pagecache_get_page+0x669/0x950 mm/filemap.c:1848 find_or_create_page include/linux/pagemap.h:402 [inline] grow_dev_page fs/buffer.c:976 [inline] grow_buffers fs/buffer.c:1045 [inline] __getblk_slow fs/buffer.c:1072 [inline] __getblk_gfp+0x221/0x7e0 fs/buffer.c:1370 sb_getblk include/linux/buffer_head.h:361 [inline] ext4_getblk fs/ext4/inode.c:877 [inline] ext4_bread_batch+0x224/0x880 fs/ext4/inode.c:943 __ext4_find_entry+0xee7/0x1990 fs/ext4/namei.c:1643 ext4_lookup_entry fs/ext4/namei.c:1744 [inline] ext4_lookup+0x3c6/0xaa0 fs/ext4/namei.c:1812 lookup_open fs/namei.c:3226 [inline] open_last_lookups fs/namei.c:3317 [inline] path_openat+0x11ab/0x3000 fs/namei.c:3506 do_filp_open+0x21c/0x460 fs/namei.c:3536 do_sys_openat2+0x13f/0x710 fs/open.c:1217 do_sys_open fs/open.c:1233 [inline] __do_sys_creat fs/open.c:1307 [inline] __se_sys_creat fs/open.c:1301 [inline] __x64_sys_creat+0x11f/0x160 fs/open.c:1301 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 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:356 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline] tlb_flush_mmu_free mm/mmu_gather.c:240 [inline] tlb_flush_mmu mm/mmu_gather.c:247 [inline] tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:326 exit_mmap+0x312/0x5c0 mm/mmap.c:3357 __mmput+0x95/0x2d0 kernel/fork.c:1153 mmput+0x59/0x170 kernel/fork.c:1176 exit_mm kernel/exit.c:539 [inline] do_exit+0xbda/0x2a50 kernel/exit.c:850 do_group_exit+0x141/0x310 kernel/exit.c:985 get_signal+0x10a0/0x1410 kernel/signal.c:2790 arch_do_signal_or_restart+0xbd/0x17c0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0x9b/0xd0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xa2/0x1a0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888125fa1f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888125fa1f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888125fa2000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888125fa2080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888125fa2100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== EXT4-fs error (device loop9): ext4_dx_csum_set:529: inode #2: comm syz.9.455: dir seems corrupt? Run e2fsck -D.