================================================================== BUG: KASAN: slab-use-after-free in ext4_insert_dentry+0x3cd/0x780 fs/ext4/namei.c:2094 Write of size 251 at addr ffff888033fa6f14 by task syz.0.0/5329 CPU: 0 UID: 0 PID: 5329 Comm: syz.0.0 Not tainted 6.15.0-rc1-syzkaller-00065-g3b07108ada81 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x28f/0x2a0 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 ext4_insert_dentry+0x3cd/0x780 fs/ext4/namei.c:2094 add_dirent_to_buf+0x311/0x660 fs/ext4/namei.c:2139 make_indexed_dir+0xcdb/0x1300 fs/ext4/namei.c:2336 ext4_add_entry+0xb3a/0xd30 fs/ext4/namei.c:2437 ext4_add_nondir+0x8d/0x290 fs/ext4/namei.c:2786 ext4_symlink+0xab0/0xe30 fs/ext4/namei.c:3426 vfs_symlink+0x137/0x2e0 fs/namei.c:4688 do_symlinkat+0x228/0x3d0 fs/namei.c:4714 __do_sys_symlink fs/namei.c:4735 [inline] __se_sys_symlink fs/namei.c:4733 [inline] __x64_sys_symlink+0x7a/0x90 fs/namei.c:4733 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fafde18d169 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:00007fafdf0a2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 00007fafde3a5fa0 RCX: 00007fafde18d169 RDX: 0000000000000000 RSI: 0000200000000cc0 RDI: 0000200000000dc0 RBP: 00007fafde20e730 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fafde3a5fa0 R15: 00007ffe7fac25d8 The buggy address belongs to the physical page: page: refcount:3 mapcount:0 mapping:ffff888031d1cd78 index:0x3f pfn:0x33fa6 memcg:ffff888040f4a000 aops:def_blk_aops ino:700000 dentry name(?):"" flags: 0x4fff10000004014(referenced|dirty|private|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff10000004014 0000000000000000 dead000000000122 ffff888031d1cd78 raw: 000000000000003f ffff888000490570 00000003ffffffff ffff888040f4a000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x148c40(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL), pid 5329, tgid 5328 (syz.0.0), ts 74950693012, free_ts 72574200727 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1717 prep_new_page mm/page_alloc.c:1725 [inline] get_page_from_freelist+0x352b/0x36c0 mm/page_alloc.c:3652 __alloc_frozen_pages_noprof+0x211/0x5b0 mm/page_alloc.c:4934 alloc_pages_mpol+0x339/0x690 mm/mempolicy.c:2301 alloc_frozen_pages_noprof mm/mempolicy.c:2372 [inline] alloc_pages_noprof+0x121/0x190 mm/mempolicy.c:2392 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2402 filemap_alloc_folio_noprof+0xe4/0x550 mm/filemap.c:1007 __filemap_get_folio+0x423/0xb40 mm/filemap.c:1969 grow_dev_folio fs/buffer.c:1039 [inline] grow_buffers fs/buffer.c:1105 [inline] __getblk_slow fs/buffer.c:1131 [inline] bdev_getblk+0x1d4/0x670 fs/buffer.c:1431 getblk_unmovable include/linux/buffer_head.h:368 [inline] ext4_getblk+0x31d/0x890 fs/ext4/inode.c:867 ext4_bread+0x2e/0x180 fs/ext4/inode.c:915 ext4_append+0x32c/0x5d0 fs/ext4/namei.c:83 make_indexed_dir+0x426/0x1300 fs/ext4/namei.c:2257 ext4_add_entry+0xb3a/0xd30 fs/ext4/namei.c:2437 ext4_add_nondir+0x8d/0x290 fs/ext4/namei.c:2786 ext4_symlink+0xab0/0xe30 fs/ext4/namei.c:3426 page last free pid 15 tgid 15 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1262 [inline] __free_frozen_pages+0xde8/0x10a0 mm/page_alloc.c:2680 pagetable_free include/linux/mm.h:3002 [inline] pagetable_dtor_free include/linux/mm.h:3100 [inline] __tlb_remove_table+0x36b/0x460 include/asm-generic/tlb.h:215 __tlb_remove_table_free mm/mmu_gather.c:227 [inline] tlb_remove_table_rcu+0x79/0xf0 mm/mmu_gather.c:290 rcu_do_batch kernel/rcu/tree.c:2568 [inline] rcu_core+0xaac/0x17a0 kernel/rcu/tree.c:2824 handle_softirqs+0x2d6/0x9b0 kernel/softirq.c:579 run_ksoftirqd+0xcf/0x130 kernel/softirq.c:968 smpboot_thread_fn+0x576/0xaa0 kernel/smpboot.c:164 kthread+0x7b7/0x940 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff888033fa6f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888033fa6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888033fa7000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888033fa7080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff888033fa7100: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================