================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 Read of size 4 at addr ffff8881268f0000 by task syz-executor/1534 CPU: 0 PID: 1534 Comm: syz-executor Not tainted 5.15.150-syzkaller-00330-g9044d25b8ff5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 ext4_evict_inode+0xea1/0x14e0 fs/ext4/inode.c:300 evict+0x2a3/0x630 fs/inode.c:587 iput_final fs/inode.c:1705 [inline] iput+0x63b/0x7e0 fs/inode.c:1731 d_delete_notify include/linux/fsnotify.h:270 [inline] vfs_rmdir+0x359/0x470 fs/namei.c:4162 do_rmdir+0x3ab/0x630 fs/namei.c:4210 __do_sys_unlinkat fs/namei.c:4390 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4384 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7fcb4e2af217 Code: 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 07 01 00 00 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:00007ffe9a400268 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007fcb4e2af217 RDX: 0000000000000200 RSI: 00007ffe9a401410 RDI: 00000000ffffff9c RBP: 00007fcb4e31d64a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffe9a401410 R13: 00007fcb4e31d64a R14: 000000000001c4b3 R15: 00007ffe9a4035f0 Allocated by task 4487: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253 vm_area_dup+0x26/0x230 kernel/fork.c:367 __split_vma+0xc1/0x470 mm/mmap.c:2752 split_vma+0x7c/0xd0 mm/mmap.c:2813 mprotect_fixup+0x4b5/0x7f0 mm/mprotect.c:484 do_mprotect_pkey+0x79e/0xb20 mm/mprotect.c:646 __do_sys_mprotect mm/mprotect.c:673 [inline] __se_sys_mprotect mm/mprotect.c:670 [inline] __x64_sys_mprotect+0x80/0x90 mm/mprotect.c:670 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 25: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kmem_cache_free+0x116/0x2e0 mm/slub.c:3535 __free_vm_area_struct+0x1c/0x20 kernel/fork.c:389 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu_common kernel/rcu/tree.c:3007 [inline] call_rcu+0x135/0x1310 kernel/rcu/tree.c:3125 free_vm_area_struct kernel/fork.c:394 [inline] vm_area_free_no_check+0xff/0x130 kernel/fork.c:408 vm_area_free+0x53/0x60 kernel/fork.c:418 remove_vma mm/mmap.c:191 [inline] exit_mmap+0x525/0x940 mm/mmap.c:3224 __mmput+0x95/0x310 kernel/fork.c:1179 mmput+0x5b/0x170 kernel/fork.c:1202 exit_mm kernel/exit.c:552 [inline] do_exit+0xb9c/0x2ca0 kernel/exit.c:865 do_group_exit+0x141/0x310 kernel/exit.c:1000 __do_sys_exit_group kernel/exit.c:1011 [inline] __se_sys_exit_group kernel/exit.c:1009 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1009 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff8881268f0000 which belongs to the cache vm_area_struct of size 232 The buggy address is located 0 bytes inside of 232-byte region [ffff8881268f0000, ffff8881268f00e8) The buggy address belongs to the page: page:ffffea00049a3c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1268f0 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881001bd500 raw: 0000000000000000 00000000000d000d 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 1534, ts 108499161592, free_ts 108324806708 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604 prep_new_page+0x1b/0x110 mm/page_alloc.c:2610 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0x134/0x200 mm/slub.c:3253 vm_area_dup+0x26/0x230 kernel/fork.c:367 dup_mmap kernel/fork.c:601 [inline] dup_mm kernel/fork.c:1521 [inline] copy_mm+0x9a1/0x13e0 kernel/fork.c:1573 copy_process+0x1149/0x3290 kernel/fork.c:2264 kernel_clone+0x21e/0x9e0 kernel/fork.c:2662 __do_sys_clone kernel/fork.c:2788 [inline] __se_sys_clone kernel/fork.c:2772 [inline] __x64_sys_clone+0x23f/0x290 kernel/fork.c:2772 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1471 [inline] free_pcp_prepare mm/page_alloc.c:1543 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3533 free_unref_page_list+0x14b/0xa60 mm/page_alloc.c:3670 release_pages+0x1310/0x1370 mm/swap.c:1009 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:320 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:338 exit_mmap+0x40d/0x940 mm/mmap.c:3218 __mmput+0x95/0x310 kernel/fork.c:1179 mmput+0x5b/0x170 kernel/fork.c:1202 exit_mm kernel/exit.c:552 [inline] do_exit+0xb9c/0x2ca0 kernel/exit.c:865 do_group_exit+0x141/0x310 kernel/exit.c:1000 get_signal+0x7a3/0x1630 kernel/signal.c:2896 arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:172 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 Memory state around the buggy address: ffff8881268eff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881268eff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881268f0000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881268f0080: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff8881268f0100: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ==================================================================