================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 Read of size 4 at addr ffff88802273e000 by task syz-executor.2/3526 CPU: 1 PID: 3526 Comm: syz-executor.2 Not tainted 5.15.160-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2904 ext4_evict_inode+0xcb7/0x1100 fs/ext4/inode.c:299 evict+0x2a4/0x620 fs/inode.c:587 d_delete_notify include/linux/fsnotify.h:261 [inline] vfs_rmdir+0x33c/0x460 fs/namei.c:4162 do_rmdir+0x368/0x670 fs/namei.c:4210 __do_sys_unlinkat fs/namei.c:4390 [inline] __se_sys_unlinkat fs/namei.c:4384 [inline] __x64_sys_unlinkat+0xdc/0xf0 fs/namei.c:4384 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f90e8b5d747 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:00007ffff766c7b8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f90e8b5d747 RDX: 0000000000000200 RSI: 00007ffff766d960 RDI: 00000000ffffff9c RBP: 00007f90e8bba636 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffff766d960 R13: 00007f90e8bba636 R14: 000000000000ce85 R15: 0000000000000007 Allocated by task 3581: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] lsm_file_alloc security/security.c:574 [inline] security_file_alloc+0x24/0x120 security/security.c:1530 __alloc_file+0xc3/0x240 fs/file_table.c:106 alloc_empty_file+0x92/0x180 fs/file_table.c:150 path_openat+0xfc/0x2f20 fs/namei.c:3728 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x500 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 3581: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x91/0x1f0 mm/slub.c:3515 file_free fs/file_table.c:55 [inline] __fput+0x620/0x890 fs/file_table.c:293 task_work_run+0x129/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff88802273e000 which belongs to the cache lsm_file_cache of size 80 The buggy address is located 0 bytes inside of 80-byte region [ffff88802273e000, ffff88802273e050) The buggy address belongs to the page: page:ffffea000089cf80 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802273e460 pfn:0x2273e flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0000744c08 ffffea00006abf48 ffff888011dec000 raw: ffff88802273e460 000000000024001a 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 2963, ts 15944563345, free_ts 13524199456 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] lsm_file_alloc security/security.c:574 [inline] security_file_alloc+0x24/0x120 security/security.c:1530 __alloc_file+0xc3/0x240 fs/file_table.c:106 alloc_empty_file+0x92/0x180 fs/file_table.c:150 path_openat+0xfc/0x2f20 fs/namei.c:3728 do_filp_open+0x21c/0x460 fs/namei.c:3769 do_sys_openat2+0x13b/0x500 fs/open.c:1253 do_sys_open fs/open.c:1269 [inline] __do_sys_openat fs/open.c:1285 [inline] __se_sys_openat fs/open.c:1280 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1280 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 kasan_depopulate_vmalloc_pte+0x66/0x80 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2545 [inline] apply_to_pmd_range mm/memory.c:2589 [inline] apply_to_pud_range mm/memory.c:2625 [inline] apply_to_p4d_range mm/memory.c:2661 [inline] __apply_to_page_range+0x9bf/0xcc0 mm/memory.c:2695 kasan_release_vmalloc+0x96/0xb0 mm/kasan/shadow.c:485 __purge_vmap_area_lazy+0x15ae/0x1740 mm/vmalloc.c:1704 _vm_unmap_aliases+0x453/0x4e0 mm/vmalloc.c:2107 change_page_attr_set_clr+0x308/0x1050 arch/x86/mm/pat/set_memory.c:1740 change_page_attr_set arch/x86/mm/pat/set_memory.c:1790 [inline] set_memory_nx+0xee/0x130 arch/x86/mm/pat/set_memory.c:1938 free_init_pages arch/x86/mm/init.c:933 [inline] free_kernel_image_pages arch/x86/mm/init.c:952 [inline] free_initmem+0x71/0xc0 arch/x86/mm/init.c:979 kernel_init+0x23/0x290 init/main.c:1513 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:300 Memory state around the buggy address: ffff88802273df00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88802273df80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88802273e000: fa fb fb fb fb fb fb fb fb fb fc fc fc fc fa fb ^ ffff88802273e080: fb fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb ffff88802273e100: fb fb fb fb fb fb fc fc fc fc fb fb fb fb fb fb ==================================================================