EXT4-fs error (device loop0): ext4_orphan_get:1394: comm syz-executor253: 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. ================================================================== BUG: KASAN: slab-use-after-free in ext4_insert_dentry+0x36a/0x6d0 fs/ext4/namei.c:2119 Write of size 251 at addr ffff8880444bff14 by task syz-executor253/5303 CPU: 0 UID: 0 PID: 5303 Comm: syz-executor253 Not tainted 6.14.0-rc1-syzkaller-00081-gbb066fe812d6 #0 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:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 __asan_memcpy+0x40/0x70 mm/kasan/shadow.c:106 ext4_insert_dentry+0x36a/0x6d0 fs/ext4/namei.c:2119 add_dirent_to_buf+0x315/0x660 fs/ext4/namei.c:2164 make_indexed_dir+0xd0e/0x1350 fs/ext4/namei.c:2361 ext4_add_entry+0xbcd/0xe00 fs/ext4/namei.c:2462 ext4_add_nondir+0x8d/0x290 fs/ext4/namei.c:2803 ext4_symlink+0x9b1/0xc90 fs/ext4/namei.c:3440 vfs_symlink+0x137/0x2e0 fs/namei.c:4671 do_symlinkat+0x222/0x3a0 fs/namei.c:4697 __do_sys_symlink fs/namei.c:4718 [inline] __se_sys_symlink fs/namei.c:4716 [inline] __x64_sys_symlink+0x7a/0x90 fs/namei.c:4716 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f2e443f4199 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 1c 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:00007ffd965d7858 EFLAGS: 00000246 ORIG_RAX: 0000000000000058 RAX: ffffffffffffffda RBX: 0030656c69662f2e RCX: 00007f2e443f4199 RDX: 0000000000000000 RSI: 0000200000000cc0 RDI: 0000200000000dc0 RBP: 0000200000000180 R08: 00007ffd965d7890 R09: 00007ffd965d7890 R10: 00007ffd965d7890 R11: 0000000000000246 R12: 0000000000000004 R13: 0000000000000000 R14: 431bde82d7b634db R15: 00007ffd965d78b0 The buggy address belongs to the physical page: page: refcount:3 mapcount:0 mapping:ffff888031cdcd78 index:0x3f pfn:0x444bf memcg:ffff88801c6b6000 aops:def_blk_aops ino:700000 dentry name(?):"" flags: 0x4fff10000004014(referenced|dirty|private|node=1|zone=1|lastcpupid=0x7ff) raw: 04fff10000004014 0000000000000000 dead000000000122 ffff888031cdcd78 raw: 000000000000003f ffff888044ecfcb0 00000003ffffffff ffff88801c6b6000 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 5303, tgid 5303 (syz-executor253), ts 63138039218, free_ts 63122419967 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4739 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_frozen_pages_noprof mm/mempolicy.c:2341 [inline] alloc_pages_noprof+0x121/0x190 mm/mempolicy.c:2361 folio_alloc_noprof+0x1e/0x30 mm/mempolicy.c:2371 filemap_alloc_folio_noprof+0xe1/0x540 mm/filemap.c:1019 __filemap_get_folio+0x438/0xae0 mm/filemap.c:1970 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:369 [inline] ext4_getblk+0x31b/0x880 fs/ext4/inode.c:864 ext4_bread+0x2e/0x180 fs/ext4/inode.c:912 ext4_append+0x327/0x5c0 fs/ext4/namei.c:83 make_indexed_dir+0x430/0x1350 fs/ext4/namei.c:2282 ext4_add_entry+0xbcd/0xe00 fs/ext4/namei.c:2462 ext4_add_nondir+0x8d/0x290 fs/ext4/namei.c:2803 ext4_symlink+0x9b1/0xc90 fs/ext4/namei.c:3440 page last free pid 16 tgid 16 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe0d/0x10e0 mm/page_alloc.c:2660 rcu_do_batch kernel/rcu/tree.c:2546 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2802 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 run_ksoftirqd+0xca/0x130 kernel/softirq.c:950 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff8880444bff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880444bff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880444c0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880444c0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880444c0100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================