================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 Read of size 4 at addr ffff8881247fb000 by task syz-executor/483 CPU: 0 PID: 483 Comm: syz-executor Not tainted 6.1.78-syzkaller-1151202-g7682e638eb17 #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 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+0x642/0x870 fs/inode.c:1817 d_delete_notify include/linux/fsnotify.h:284 [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 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fd80b27c6c7 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:00007ffd973d4128 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007fd80b27c6c7 RDX: 0000000000000200 RSI: 00007ffd973d52d0 RDI: 00000000ffffff9c RBP: 00007fd80b2c8336 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffd973d52d0 R13: 00007fd80b2c8336 R14: 000000000000bce0 R15: 0000000000000007 Allocated by task 441: 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_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x9c/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:957 [inline] __kmalloc_node_track_caller+0xb3/0x1e0 mm/slab_common.c:977 kmemdup_nul+0x2f/0xa0 mm/util.c:157 security_context_to_sid_core+0xd8/0x850 security/selinux/ss/services.c:1533 security_context_to_sid+0x3a/0x50 security/selinux/ss/services.c:1609 selinux_inode_setxattr+0x7a8/0xd40 security/selinux/hooks.c:3216 security_inode_setxattr+0xca/0x180 security/security.c:1376 __vfs_setxattr_locked+0x9d/0x230 fs/xattr.c:268 vfs_setxattr+0x21d/0x420 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x250/0x2b0 fs/xattr.c:617 path_setxattr+0x1bc/0x2a0 fs/xattr.c:636 __do_sys_lsetxattr fs/xattr.c:659 [inline] __se_sys_lsetxattr fs/xattr.c:655 [inline] __x64_sys_lsetxattr+0xc2/0xe0 fs/xattr.c:655 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 441: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook mm/slub.c:1771 [inline] slab_free mm/slub.c:3684 [inline] __kmem_cache_free+0x218/0x3b0 mm/slub.c:3697 kfree+0x7a/0xf0 mm/slab_common.c:1009 security_context_to_sid_core+0x703/0x850 security/selinux/ss/services.c:1587 security_context_to_sid+0x3a/0x50 security/selinux/ss/services.c:1609 selinux_inode_setxattr+0x7a8/0xd40 security/selinux/hooks.c:3216 security_inode_setxattr+0xca/0x180 security/security.c:1376 __vfs_setxattr_locked+0x9d/0x230 fs/xattr.c:268 vfs_setxattr+0x21d/0x420 fs/xattr.c:309 do_setxattr fs/xattr.c:594 [inline] setxattr+0x250/0x2b0 fs/xattr.c:617 path_setxattr+0x1bc/0x2a0 fs/xattr.c:636 __do_sys_lsetxattr fs/xattr.c:659 [inline] __se_sys_lsetxattr fs/xattr.c:655 [inline] __x64_sys_lsetxattr+0xc2/0xe0 fs/xattr.c:655 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff8881247fb000 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 0 bytes inside of 32-byte region [ffff8881247fb000, ffff8881247fb020) The buggy address belongs to the physical page: page:ffffea000491fec0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1247fb flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100042600 raw: 0000000000000000 0000000000400040 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 441, tgid 441 (udevd), ts 48435854512, free_ts 48244728891 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:5712 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] __kmem_cache_alloc_node+0x1af/0x250 mm/slub.c:3460 __do_kmalloc_node mm/slab_common.c:956 [inline] __kmalloc+0xa3/0x1e0 mm/slab_common.c:970 kmalloc include/linux/slab.h:558 [inline] shmem_initxattrs+0xd4/0x200 mm/shmem.c:3302 security_inode_init_security+0x252/0x390 security/security.c:1133 shmem_mknod+0xb8/0x1d0 mm/shmem.c:2954 shmem_create+0x2c/0x40 mm/shmem.c:3013 lookup_open fs/namei.c:3483 [inline] open_last_lookups fs/namei.c:3551 [inline] path_openat+0x12ee/0x2d60 fs/namei.c:3781 do_filp_open+0x230/0x480 fs/namei.c:3811 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:314 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+0x421/0x940 mm/mmap.c:3348 __mmput+0x95/0x310 kernel/fork.c:1298 mmput+0x56/0x170 kernel/fork.c:1321 exit_mm kernel/exit.c:566 [inline] do_exit+0xb29/0x2b80 kernel/exit.c:862 do_group_exit+0x21a/0x2d0 kernel/exit.c:1025 get_signal+0x169d/0x1820 kernel/signal.c:2880 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x74/0xa0 kernel/entry/common.c:168 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x26/0x140 kernel/entry/common.c:297 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:87 Memory state around the buggy address: ffff8881247faf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881247faf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881247fb000: fa fb fb fb fc fc fc fc 00 00 00 00 fc fc fc fc ^ ffff8881247fb080: 00 00 01 fc fc fc fc fc fa fb fb fb fc fc fc fc ffff8881247fb100: fa fb fb fb fc fc fc fc fa fb fb fb fc fc 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 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 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