================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xc1f/0xc30 fs/ext4/xattr.c:2911 Read of size 4 at addr ffff8881ecd7f000 by task syz-executor.2/375 CPU: 0 PID: 375 Comm: syz-executor.2 Not tainted 5.4.274-syzkaller-00002-g6f97bd951d82 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 ext4_xattr_delete_inode+0xc1f/0xc30 fs/ext4/xattr.c:2911 ext4_evict_inode+0x1378/0x1ac0 fs/ext4/inode.c:318 evict+0x29b/0x6a0 fs/inode.c:575 d_delete_notify include/linux/fsnotify.h:224 [inline] vfs_rmdir+0x24b/0x3c0 fs/namei.c:4040 do_rmdir+0x2c1/0x580 fs/namei.c:4088 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 RIP: 0033:0x7f5494c1c707 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:00007fff88198548 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f5494c1c707 RDX: 0000000000000200 RSI: 00007fff881996f0 RDI: 00000000ffffff9c RBP: 00007f5494c796c6 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007fff881996f0 R13: 00007f5494c796c6 R14: 00000000000065aa R15: 0000000000000007 Allocated by task 157: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 mm/kasan/common.c:529 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 vm_area_alloc+0x20/0xe0 kernel/fork.c:350 mmap_region+0x989/0x16f0 mm/mmap.c:1782 do_mmap+0x822/0xd30 mm/mmap.c:1581 do_mmap_pgoff include/linux/mm.h:2480 [inline] vm_mmap_pgoff+0x1b5/0x260 mm/util.c:528 load_elf_interp+0x62f/0xef0 fs/binfmt_elf.c:590 load_elf_binary+0x1adc/0x2750 fs/binfmt_elf.c:1059 search_binary_handler+0x16e/0x5a0 fs/exec.c:1700 exec_binprm+0x91/0x3a0 fs/exec.c:1743 __do_execve_file+0xbf7/0x10d0 fs/exec.c:1875 do_execveat_common fs/exec.c:1921 [inline] do_execve fs/exec.c:1938 [inline] __do_sys_execve fs/exec.c:2014 [inline] __se_sys_execve fs/exec.c:2009 [inline] __x64_sys_execve+0x90/0xa0 fs/exec.c:2009 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8881ecd7f000 which belongs to the cache vm_area_struct of size 232 The buggy address is located 0 bytes inside of 232-byte region [ffff8881ecd7f000, ffff8881ecd7f0e8) The buggy address belongs to the page: page:ffffea0007b35fc0 refcount:1 mapcount:0 mapping:ffff8881f5d04a00 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881f5d04a00 raw: 0000000000000000 0000000000140014 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) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0x109/0x250 mm/slub.c:2842 kmem_cache_zalloc include/linux/slab.h:680 [inline] __kernfs_new_node+0xdb/0x6e0 fs/kernfs/dir.c:639 kernfs_new_node+0x130/0x230 fs/kernfs/dir.c:717 __kernfs_create_file+0x45/0x260 fs/kernfs/file.c:1001 sysfs_add_file_mode_ns+0x292/0x340 fs/sysfs/file.c:306 sysfs_merge_group+0x1fe/0x450 fs/sysfs/group.c:342 dpm_sysfs_add+0xcf/0x270 drivers/base/power/sysfs.c:656 device_add+0x536/0xbb0 drivers/base/core.c:2865 usb_new_device+0xbbc/0x1760 drivers/usb/core/hub.c:2581 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4953 [inline] __free_pages+0xaf/0x140 mm/page_alloc.c:4961 __free_slab+0x221/0x2e0 mm/slub.c:1774 __slab_free+0x34b/0x360 mm/slub.c:3012 qlist_free_all+0x43/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x1d9/0x210 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x41/0x210 mm/kasan/common.c:507 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] kmem_cache_alloc+0xd9/0x250 mm/slub.c:2842 getname_flags+0xb8/0x4e0 fs/namei.c:141 user_path_at_empty+0x28/0x50 fs/namei.c:2703 do_readlinkat+0x114/0x3a0 fs/stat.c:398 __do_sys_readlink fs/stat.c:431 [inline] __se_sys_readlink fs/stat.c:428 [inline] __x64_sys_readlink+0x7b/0x90 fs/stat.c:428 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881ecd7ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881ecd7ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881ecd7f000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8881ecd7f080: 00 fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 ffff8881ecd7f100: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ==================================================================