================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 Read of size 4 at addr ffff888059aef000 by task syz-executor.2/4011 CPU: 1 PID: 4011 Comm: syz-executor.2 Not tainted 6.1.94-syzkaller #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+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 ext4_xattr_delete_inode+0xcd0/0xce0 fs/ext4/xattr.c:2905 ext4_evict_inode+0xc77/0x1150 fs/ext4/inode.c:296 evict+0x2a4/0x620 fs/inode.c:666 d_delete_notify include/linux/fsnotify.h:261 [inline] vfs_rmdir+0x381/0x4b0 fs/namei.c:4206 do_rmdir+0x3a2/0x590 fs/namei.c:4254 __do_sys_unlinkat fs/namei.c:4434 [inline] __se_sys_unlinkat fs/namei.c:4428 [inline] __x64_sys_unlinkat+0xdc/0xf0 fs/namei.c:4428 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:0x7fd2eee7c707 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:00007ffe766ef3b8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007fd2eee7c707 RDX: 0000000000000200 RSI: 00007ffe766f0560 RDI: 00000000ffffff9c RBP: 00007fd2eeed96c6 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffe766f0560 R13: 00007fd2eeed96c6 R14: 000000000003b037 R15: 0000000000000008 Allocated by task 5881: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x10c/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:682 [inline] __kernfs_new_node+0xd4/0x870 fs/kernfs/dir.c:608 kernfs_new_node+0x136/0x230 fs/kernfs/dir.c:684 __kernfs_create_file+0x45/0x2e0 fs/kernfs/file.c:1043 sysfs_add_file_mode_ns+0x246/0x300 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x545/0xed0 fs/sysfs/group.c:148 internal_create_groups fs/sysfs/group.c:188 [inline] sysfs_create_groups+0x52/0x110 fs/sysfs/group.c:214 device_add_groups drivers/base/core.c:2741 [inline] device_add_attrs+0x133/0x5f0 drivers/base/core.c:2895 device_add+0x63e/0xfd0 drivers/base/core.c:3637 add_partition+0x533/0x8b0 block/partitions/core.c:385 blk_add_partition block/partitions/core.c:581 [inline] blk_add_partitions block/partitions/core.c:651 [inline] bdev_disk_changed+0xb71/0x1460 block/partitions/core.c:693 loop_reread_partitions drivers/block/loop.c:516 [inline] loop_set_status+0x72a/0x910 drivers/block/loop.c:1320 lo_ioctl+0xd04/0x2010 blkdev_ioctl+0x3a9/0x760 block/ioctl.c:619 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856 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 ffff888059aef000 which belongs to the cache kernfs_node_cache of size 168 The buggy address is located 0 bytes inside of 168-byte region [ffff888059aef000, ffff888059aef0a8) The buggy address belongs to the physical page: page:ffffea000166bbc0 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888059aef658 pfn:0x59aef flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000166a288 ffffea00016c4808 ffff888140009c80 raw: ffff888059aef658 0000000000110006 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 3576, tgid 3576 (syz-executor.0), ts 64009596478, free_ts 15768874981 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5547 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x1a5/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:682 [inline] __kernfs_new_node+0xd4/0x870 fs/kernfs/dir.c:608 kernfs_new_node+0x136/0x230 fs/kernfs/dir.c:684 __kernfs_create_file+0x45/0x2e0 fs/kernfs/file.c:1043 sysfs_add_file_mode_ns+0x246/0x300 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x545/0xed0 fs/sysfs/group.c:148 internal_create_groups fs/sysfs/group.c:188 [inline] sysfs_create_groups+0x52/0x110 fs/sysfs/group.c:214 create_dir lib/kobject.c:68 [inline] kobject_add_internal+0x725/0xd10 lib/kobject.c:231 kobject_add_varg lib/kobject.c:366 [inline] kobject_init_and_add+0x120/0x190 lib/kobject.c:449 netdev_queue_add_kobject net/core/net-sysfs.c:1664 [inline] netdev_queue_update_kobjects+0x1f2/0x480 net/core/net-sysfs.c:1716 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1440 [inline] free_pcp_prepare mm/page_alloc.c:1490 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453 free_contig_range+0x9a/0x150 mm/page_alloc.c:9507 destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x416/0x46b mm/debug_vm_pgtable.c:1354 do_one_initcall+0x265/0x8f0 init/main.c:1298 do_initcall_level+0x157/0x207 init/main.c:1371 do_initcalls+0x49/0x86 init/main.c:1387 kernel_init_freeable+0x45c/0x60f init/main.c:1626 kernel_init+0x19/0x290 init/main.c:1514 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Memory state around the buggy address: ffff888059aeef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888059aeef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888059aef000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888059aef080: fb fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb ffff888059aef100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================