loop0: detected capacity change from 0 to 512 EXT4-fs error (device loop0): ext4_iget_extra_inode:4692: inode #15: comm syz.0.0: corrupted in-inode xattr: invalid ea_ino EXT4-fs error (device loop0): ext4_orphan_get:1395: comm syz.0.0: couldn't read orphan inode 15 (err -117) EXT4-fs (loop0): mounted filesystem 00000007-0000-0000-0000-000000000000 r/w without journal. Quota mode: none. EXT4-fs error (device loop0): ext4_lookup:1789: inode #13: comm syz.0.0: iget: bad extended attribute block 7177 EXT4-fs error (device loop0): ext4_lookup:1789: inode #13: comm syz.0.0: iget: bad extended attribute block 7177 ================================================================== BUG: KASAN: slab-use-after-free in ext4_insert_dentry+0x3cd/0x780 fs/ext4/namei.c:2094 Write of size 251 at addr ffff888052dbff14 by task syz.0.0/5328 CPU: 0 UID: 0 PID: 5328 Comm: syz.0.0 Not tainted 6.14.0-syzkaller-13423-ga8662bcd2ff1 #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:0x7fd76778d169 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:00007fd768503038 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 00007fd7679a5fa0 RCX: 00007fd76778d169 RDX: 0000000000000000 RSI: 0000200000000cc0 RDI: 0000200000000dc0 RBP: 00007fd76780e2a0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd7679a5fa0 R15: 00007ffe0db156a8 The buggy address belongs to the physical page: page: refcount:3 mapcount:0 mapping:ffff888031d34d78 index:0x3f pfn:0x52dbf memcg:ffff88803eabe000 aops:def_blk_aops ino:700000 dentry name(?):"" flags: 0x4fff10000004014(referenced|dirty|private|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff10000004014 0000000000000000 dead000000000122 ffff888031d34d78 raw: 000000000000003f ffff888044c613a0 00000003ffffffff ffff88803eabe000 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 5328, tgid 5327 (syz.0.0), ts 69445872399, free_ts 69281933881 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 57 tgid 57 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 discard_slab mm/slub.c:2720 [inline] __put_partials+0x160/0x1c0 mm/slub.c:3189 put_cpu_partial+0x17e/0x250 mm/slub.c:3264 __slab_free+0x294/0x390 mm/slub.c:4516 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9a/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:329 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4151 [inline] slab_alloc_node mm/slub.c:4200 [inline] __kmalloc_cache_noprof+0x1c8/0x370 mm/slub.c:4357 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1039 [inline] nsim_fib4_rt_create drivers/net/netdevsim/fib.c:280 [inline] nsim_fib4_rt_insert drivers/net/netdevsim/fib.c:426 [inline] nsim_fib4_event drivers/net/netdevsim/fib.c:464 [inline] nsim_fib_event drivers/net/netdevsim/fib.c:884 [inline] nsim_fib_event_work+0xe04/0x3f10 drivers/net/netdevsim/fib.c:1493 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xac3/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd50 kernel/workqueue.c:3400 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: ffff888052dbff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888052dbff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888052dc0000: fa fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff888052dc0080: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff888052dc0100: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc ==================================================================