================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 Read of size 4 at addr ffff888118f88000 by task syz-executor/470 CPU: 1 PID: 470 Comm: syz-executor Not tainted 6.1.99-syzkaller-1151476-ga43e7c2c12af #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:427 kasan_report+0x13c/0x170 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 ext4_evict_inode+0xef9/0x1550 fs/ext4/inode.c:296 evict+0x2a3/0x630 fs/inode.c:666 iput_final fs/inode.c:1791 [inline] iput+0x616/0x690 fs/inode.c:1817 d_delete_notify include/linux/fsnotify.h:292 [inline] vfs_rmdir+0x3c2/0x500 fs/namei.c:4205 do_rmdir+0x3ab/0x630 fs/namei.c:4253 __do_sys_unlinkat fs/namei.c:4433 [inline] __se_sys_unlinkat fs/namei.c:4427 [inline] __x64_sys_unlinkat+0xdf/0xf0 fs/namei.c:4427 x64_sys_call+0x6e9/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:264 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7ff274179457 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:00007ffdff9ab518 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007ff274179457 RDX: 0000000000000200 RSI: 00007ffdff9ac6c0 RDI: 00000000ffffff9c RBP: 00007ff2741e77b4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffdff9ac6c0 R13: 00007ff2741e77b4 R14: 000000000000c84b R15: 00007ffdff9ae870 Allocated by task 126: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] slab_alloc mm/slub.c:3429 [inline] __kmem_cache_alloc_lru mm/slub.c:3436 [inline] kmem_cache_alloc+0x175/0x2c0 mm/slub.c:3445 kmem_cache_zalloc include/linux/slab.h:682 [inline] lsm_file_alloc security/security.c:575 [inline] security_file_alloc+0x29/0x120 security/security.c:1543 __alloc_file+0xb2/0x2a0 fs/file_table.c:143 alloc_empty_file+0x95/0x180 fs/file_table.c:187 path_openat+0xec/0x2d60 fs/namei.c:3770 do_filp_open+0x230/0x480 fs/namei.c:3811 do_sys_openat2+0x151/0x870 fs/open.c:1341 do_sys_open fs/open.c:1357 [inline] __do_sys_openat fs/open.c:1373 [inline] __se_sys_openat fs/open.c:1368 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1368 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff888118f88000 which belongs to the cache lsm_file_cache of size 16 The buggy address is located 0 bytes inside of 16-byte region [ffff888118f88000, ffff888118f88010) The buggy address belongs to the physical page: page:ffffea000463e200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888118f888a0 pfn:0x118f88 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 ffffea00045d95c0 dead000000000002 ffff8881002b0600 raw: ffff888118f888a0 0000000080800000 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 126, tgid 126 (touch), ts 5249355725, free_ts 5248318149 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:2590 prep_new_page+0x1b/0x110 mm/page_alloc.c:2597 get_page_from_freelist+0x27ea/0x2870 mm/page_alloc.c:4425 __alloc_pages+0x3a1/0x780 mm/page_alloc.c:5714 alloc_slab_page+0x6c/0xf0 allocate_slab mm/slub.c:1962 [inline] new_slab+0x90/0x3e0 mm/slub.c:2015 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3203 __slab_alloc+0x5d/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] slab_alloc mm/slub.c:3429 [inline] __kmem_cache_alloc_lru mm/slub.c:3436 [inline] kmem_cache_alloc+0x1b9/0x2c0 mm/slub.c:3445 kmem_cache_zalloc include/linux/slab.h:682 [inline] lsm_file_alloc security/security.c:575 [inline] security_file_alloc+0x29/0x120 security/security.c:1543 __alloc_file+0xb2/0x2a0 fs/file_table.c:143 alloc_empty_file+0x95/0x180 fs/file_table.c:187 path_openat+0xec/0x2d60 fs/namei.c:3770 do_filp_open+0x230/0x480 fs/namei.c:3811 do_sys_openat2+0x151/0x870 fs/open.c:1341 do_sys_open fs/open.c:1357 [inline] __do_sys_openat fs/open.c:1373 [inline] __se_sys_openat fs/open.c:1368 [inline] __x64_sys_openat+0x243/0x290 fs/open.c:1368 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1498 [inline] free_pcp_prepare mm/page_alloc.c:1572 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3498 free_unref_page_list+0xf1/0x7b0 mm/page_alloc.c:3646 release_pages+0xf7f/0xfe0 mm/swap.c:1063 free_pages_and_swap_cache+0x8a/0xa0 mm/swap_state.c:315 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1e0/0x3f0 mm/mmu_gather.c:361 exit_mmap+0x460/0xbe0 mm/mmap.c:3348 __mmput+0x95/0x310 kernel/fork.c:1298 mmput+0x56/0x170 kernel/fork.c:1321 exec_mmap+0x417/0x4a0 fs/exec.c:1043 begin_new_exec+0xb65/0x1d20 fs/exec.c:1303 load_elf_binary+0x945/0x26b0 fs/binfmt_elf.c:1002 search_binary_handler fs/exec.c:1739 [inline] exec_binprm fs/exec.c:1780 [inline] bprm_execve+0x731/0x1480 fs/exec.c:1849 do_execveat_common+0x90a/0xab0 fs/exec.c:1954 do_execve fs/exec.c:2028 [inline] __do_sys_execve fs/exec.c:2104 [inline] __se_sys_execve fs/exec.c:2099 [inline] __x64_sys_execve+0x92/0xb0 fs/exec.c:2099 x64_sys_call+0x1c5/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:60 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81 Memory state around the buggy address: ffff888118f87f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888118f87f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888118f88000: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ^ ffff888118f88080: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ffff888118f88100: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc ================================================================== EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs (loop0): unmounting filesystem. EXT4-fs error (device loop0): ext4_xattr_inode_iget:404: comm syz-executor: inode #1: comm syz-executor: iget: illegal inode # EXT4-fs error (device loop0): ext4_xattr_inode_iget:409: comm syz-executor: error while reading EA inode 1 err=-117