================================================================== BUG: KASAN: use-after-free in ext4_xattr_delete_inode+0xba6/0xbb0 fs/ext4/xattr.c:2913 Read of size 4 at addr ffff88812982d000 by task syz-executor/434 CPU: 1 PID: 434 Comm: syz-executor Not tainted 6.1.141-syzkaller-1169943-g7011769d221c #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x210 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:427 kasan_report+0x122/0x150 mm/kasan/report.c:531 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 ext4_xattr_delete_inode+0xba6/0xbb0 fs/ext4/xattr.c:2913 ext4_evict_inode+0xe58/0x1460 fs/ext4/inode.c:296 evict+0x493/0x890 fs/inode.c:705 iput_final fs/inode.c:1834 [inline] iput+0x620/0x670 fs/inode.c:1860 d_delete_notify include/linux/fsnotify.h:292 [inline] vfs_rmdir+0x3bf/0x500 fs/namei.c:4203 do_rmdir+0x259/0x6a0 fs/namei.c:4251 __do_sys_unlinkat fs/namei.c:4431 [inline] __se_sys_unlinkat fs/namei.c:4425 [inline] __x64_sys_unlinkat+0xc7/0xf0 fs/namei.c:4425 x64_sys_call+0x79f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:264 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f913bd79457 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:00007ffed154b3e8 EFLAGS: 00000207 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 00007f913bd79457 RDX: 0000000000000200 RSI: 00007ffed154c590 RDI: 00000000ffffff9c RBP: 00007f913bde77b4 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000100 R11: 0000000000000207 R12: 00007ffed154c590 R13: 00007f913bde77b4 R14: 000000000000d2cc R15: 00007ffed154e740 Allocated by task 319: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x72/0x80 mm/kasan/common.c:333 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x4f/0x2d0 mm/slab.h:768 slab_alloc_node mm/slub.c:3421 [inline] slab_alloc mm/slub.c:3431 [inline] __kmem_cache_alloc_lru mm/slub.c:3438 [inline] kmem_cache_alloc+0x16e/0x330 mm/slub.c:3447 kmem_cache_zalloc include/linux/slab.h:689 [inline] __kernfs_new_node+0xdb/0x680 fs/kernfs/dir.c:614 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:690 __kernfs_create_file+0x4e/0x270 fs/kernfs/file.c:1049 sysfs_add_file_mode_ns+0x1ce/0x270 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x495/0xd00 fs/sysfs/group.c:148 internal_create_groups fs/sysfs/group.c:188 [inline] sysfs_create_groups+0x58/0x120 fs/sysfs/group.c:214 device_add_groups drivers/base/core.c:2753 [inline] device_add_attrs+0xdb/0x810 drivers/base/core.c:2901 device_add+0x5f1/0xef0 drivers/base/core.c:3649 netdev_register_kobject+0x179/0x320 net/core/net-sysfs.c:2009 register_netdevice+0xe3d/0x14a0 net/core/dev.c:10156 __ip_tunnel_create+0x33e/0x440 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x2f2/0x7d0 net/ipv4/ip_tunnel.c:1100 ipgre_tap_init_net+0x29/0x30 net/ipv4/ip_gre.c:1700 ops_init+0x1c8/0x4a0 net/core/net_namespace.c:138 setup_net+0x4ab/0xcb0 net/core/net_namespace.c:335 copy_net_ns+0x355/0x5c0 net/core/net_namespace.c:481 create_new_namespaces+0x3a2/0x660 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x120/0x170 kernel/nsproxy.c:226 ksys_unshare+0x4ac/0x7b0 kernel/fork.c:3388 __do_sys_unshare kernel/fork.c:3459 [inline] __se_sys_unshare kernel/fork.c:3457 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3457 x64_sys_call+0x767/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:273 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 44: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x31/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x132/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+0xc2/0x190 mm/slub.c:1771 slab_free mm/slub.c:3686 [inline] kmem_cache_free+0x12d/0x300 mm/slub.c:3711 kernfs_put+0x310/0x480 fs/kernfs/dir.c:568 kernfs_remove_by_name_ns+0xea/0x160 fs/kernfs/dir.c:1667 kernfs_remove_by_name include/linux/kernfs.h:635 [inline] remove_files fs/sysfs/group.c:28 [inline] sysfs_remove_group+0x105/0x2a0 fs/sysfs/group.c:288 sysfs_remove_groups+0x56/0xb0 fs/sysfs/group.c:312 device_remove_groups drivers/base/core.c:2760 [inline] device_remove_attrs+0x205/0x250 drivers/base/core.c:2980 device_del+0x69c/0xeb0 drivers/base/core.c:3885 netdev_unregister_kobject+0x186/0x250 net/core/net-sysfs.c:1981 unregister_netdevice_many+0x135b/0x1820 net/core/dev.c:10966 ip_tunnel_delete_nets+0x346/0x390 net/ipv4/ip_tunnel.c:1153 ipgre_tap_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1705 ops_exit_list net/core/net_namespace.c:177 [inline] cleanup_net+0x62d/0xb00 net/core/net_namespace.c:604 process_one_work+0x71f/0xc40 kernel/workqueue.c:2299 worker_thread+0xa29/0x11f0 kernel/workqueue.c:2446 kthread+0x281/0x320 kernel/kthread.c:386 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88812982d000 which belongs to the cache kernfs_node_cache of size 136 The buggy address is located 0 bytes inside of 136-byte region [ffff88812982d000, ffff88812982d088) The buggy address belongs to the physical page: page:ffffea0004a60b40 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12982d flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881002ad080 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), pid 319, tgid 319 (syz-executor), ts 31193903638, free_ts 31171774325 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2637 prep_new_page+0x1c/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x2c7b/0x2cf0 mm/page_alloc.c:4539 __alloc_pages+0x19e/0x3a0 mm/page_alloc.c:5850 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1962 [inline] new_slab+0x98/0x3d0 mm/slub.c:2015 ___slab_alloc+0x6f6/0xb50 mm/slub.c:3203 __slab_alloc+0x5e/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] slab_alloc mm/slub.c:3431 [inline] __kmem_cache_alloc_lru mm/slub.c:3438 [inline] kmem_cache_alloc+0x1b0/0x330 mm/slub.c:3447 kmem_cache_zalloc include/linux/slab.h:689 [inline] __kernfs_new_node+0xdb/0x680 fs/kernfs/dir.c:614 kernfs_new_node+0x150/0x260 fs/kernfs/dir.c:690 __kernfs_create_file+0x4e/0x270 fs/kernfs/file.c:1049 sysfs_add_file_mode_ns+0x1ce/0x270 fs/sysfs/file.c:294 create_files fs/sysfs/group.c:64 [inline] internal_create_group+0x495/0xd00 fs/sysfs/group.c:148 internal_create_groups fs/sysfs/group.c:188 [inline] sysfs_create_groups+0x58/0x120 fs/sysfs/group.c:214 device_add_groups drivers/base/core.c:2753 [inline] device_add_attrs+0xdb/0x810 drivers/base/core.c:2901 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1545 [inline] free_pcp_prepare mm/page_alloc.c:1619 [inline] free_unref_page_prepare+0x742/0x750 mm/page_alloc.c:3581 free_unref_page_list+0xba/0x7c0 mm/page_alloc.c:3729 release_pages+0xad1/0xb20 mm/swap.c:1043 free_pages_and_swap_cache+0x86/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+0x1aa/0x370 mm/mmu_gather.c:361 exit_mmap+0x3c7/0xa40 mm/mmap.c:3359 __mmput+0x93/0x320 kernel/fork.c:1297 mmput+0x4b/0x150 kernel/fork.c:1320 exit_mm kernel/exit.c:568 [inline] do_exit+0x979/0x2650 kernel/exit.c:864 do_group_exit+0x210/0x2d0 kernel/exit.c:1027 __do_sys_exit_group kernel/exit.c:1038 [inline] __se_sys_exit_group kernel/exit.c:1036 [inline] __x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1036 x64_sys_call+0x7b4/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:232 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88812982cf00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88812982cf80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88812982d000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88812982d080: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb ffff88812982d100: fb fb fb fb fb fb fb fb fb fb fc fc 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 (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.