================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 Read of size 4 at addr ffff888121605000 by task syz-executor/499 CPU: 0 PID: 499 Comm: syz-executor Not tainted 5.10.223-syzkaller-1003215-g0890c03b8b7d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/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 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 ext4_xattr_delete_inode+0xc67/0xc80 fs/ext4/xattr.c:2894 ext4_evict_inode+0x1095/0x1730 fs/ext4/inode.c:300 evict+0x2a3/0x6c0 fs/inode.c:577 iput_final fs/inode.c:1697 [inline] iput+0x632/0x7e0 fs/inode.c:1723 d_delete_notify include/linux/fsnotify.h:267 [inline] vfs_rmdir+0x271/0x3f0 fs/namei.c:3865 do_rmdir+0x2cf/0x5c0 fs/namei.c:3912 __do_sys_unlinkat fs/namei.c:4076 [inline] __se_sys_unlinkat fs/namei.c:4070 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4070 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f852b7c06c7 Code: 73 01 c3 48 c7 c1 b0 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffefcc7cfd8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f852b7c06c7 RDX: 0000000000000200 RSI: 00007ffefcc7e180 RDI: 00000000ffffff9c RBP: 00007f852b80c336 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffefcc7e180 R13: 00007f852b80c336 R14: 000000000000b818 R15: 0000000000000007 Allocated by task 477: 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:430 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:463 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 vm_area_alloc+0x24/0x160 kernel/fork.c:358 do_brk_flags+0x747/0xb80 mm/mmap.c:3243 __do_sys_brk mm/mmap.c:289 [inline] __se_sys_brk+0x456/0x730 mm/mmap.c:211 __x64_sys_brk+0x38/0x40 mm/mmap.c:211 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 477: 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+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kmem_cache_free+0xa9/0x1e0 mm/slub.c:3219 vm_area_free+0x52/0xf0 kernel/fork.c:386 __free_vma mm/mmap.c:179 [inline] put_vma mm/mmap.c:186 [inline] remove_vma mm/mmap.c:205 [inline] exit_mmap+0x494/0x5c0 mm/mmap.c:3363 __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:2782 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 The buggy address belongs to the object at ffff888121605000 which belongs to the cache vm_area_struct of size 232 The buggy address is located 0 bytes inside of 232-byte region [ffff888121605000, ffff8881216050e8) The buggy address belongs to the page: page:ffffea0004858140 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x121605 flags: 0x4000000000000200(slab) raw: 4000000000000200 dead000000000100 dead000000000122 ffff888100190a80 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 477, ts 46281410892, free_ts 46281304373 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 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x1b9/0x2e0 mm/slub.c:2960 vm_area_alloc+0x24/0x160 kernel/fork.c:358 mmap_region+0xac8/0x1af0 mm/mmap.c:1848 do_mmap+0x800/0xeb0 mm/mmap.c:1650 vm_mmap_pgoff+0x201/0x390 mm/util.c:543 vm_mmap+0x8d/0xb0 mm/util.c:563 elf_map+0x19c/0x240 fs/binfmt_elf.c:389 load_elf_binary+0xfe0/0x2750 fs/binfmt_elf.c:1138 search_binary_handler fs/exec.c:1722 [inline] exec_binprm fs/exec.c:1763 [inline] bprm_execve+0x81b/0x1600 fs/exec.c:1839 do_execveat_common+0x959/0xac0 fs/exec.c:1950 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 shift_arg_pages fs/exec.c:736 [inline] setup_arg_pages+0x948/0xa50 fs/exec.c:831 load_elf_binary+0xbab/0x2750 fs/binfmt_elf.c:1015 search_binary_handler fs/exec.c:1722 [inline] exec_binprm fs/exec.c:1763 [inline] bprm_execve+0x81b/0x1600 fs/exec.c:1839 do_execveat_common+0x959/0xac0 fs/exec.c:1950 do_execve fs/exec.c:2020 [inline] __do_sys_execve fs/exec.c:2096 [inline] __se_sys_execve fs/exec.c:2091 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2091 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Memory state around the buggy address: ffff888121604f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888121604f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888121605000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888121605080: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff888121605100: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb ==================================================================