================================================================== BUG: KASAN: slab-use-after-free in __hlist_del include/linux/list.h:982 [inline] BUG: KASAN: slab-use-after-free in hlist_del_rcu include/linux/rculist.h:560 [inline] BUG: KASAN: slab-use-after-free in __xfrm_state_delete+0x696/0xca0 net/xfrm/xfrm_state.c:830 Write of size 8 at addr ffff888057310470 by task kworker/u8:2/35 CPU: 0 UID: 0 PID: 35 Comm: kworker/u8:2 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025 Workqueue: events_unbound toggle_allocation_gate Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 __hlist_del include/linux/list.h:982 [inline] hlist_del_rcu include/linux/rculist.h:560 [inline] __xfrm_state_delete+0x696/0xca0 net/xfrm/xfrm_state.c:830 xfrm_state_delete net/xfrm/xfrm_state.c:856 [inline] xfrm_state_delete_tunnel net/xfrm/xfrm_state.c:3091 [inline] __xfrm_state_delete+0x87b/0xca0 net/xfrm/xfrm_state.c:837 xfrm_timer_handler+0x18f/0xa00 net/xfrm/xfrm_state.c:716 __run_hrtimer kernel/time/hrtimer.c:1761 [inline] __hrtimer_run_queues+0x529/0xc60 kernel/time/hrtimer.c:1825 hrtimer_run_softirq+0x187/0x2b0 kernel/time/hrtimer.c:1842 handle_softirqs+0x283/0x870 kernel/softirq.c:579 __do_softirq kernel/softirq.c:613 [inline] invoke_softirq kernel/softirq.c:453 [inline] __irq_exit_rcu+0xca/0x1f0 kernel/softirq.c:680 irq_exit_rcu+0x9/0x30 kernel/softirq.c:696 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1050 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1050 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:csd_lock_wait kernel/smp.c:342 [inline] RIP: 0010:smp_call_function_many_cond+0xd33/0x12d0 kernel/smp.c:877 Code: 45 8b 2c 24 44 89 ee 83 e6 01 31 ff e8 b6 62 0b 00 41 83 e5 01 49 bd 00 00 00 00 00 fc ff df 75 07 e8 61 5e 0b 00 eb 38 f3 90 <42> 0f b6 04 2b 84 c0 75 11 41 f7 04 24 01 00 00 00 74 1e e8 45 5e RSP: 0018:ffffc90000ab7660 EFLAGS: 00000293 RAX: ffffffff81b44e0b RBX: 1ffff110170e7f61 RCX: ffff888020ee9e00 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000 RBP: ffffc90000ab77e0 R08: ffffffff8fa37e37 R09: 1ffffffff1f46fc6 R10: dffffc0000000000 R11: fffffbfff1f46fc7 R12: ffff8880b873fb08 R13: dffffc0000000000 R14: ffff8880b863b1c0 R15: 0000000000000001 on_each_cpu_cond_mask+0x3f/0x80 kernel/smp.c:1044 on_each_cpu include/linux/smp.h:71 [inline] smp_text_poke_sync_each_cpu arch/x86/kernel/alternative.c:2653 [inline] smp_text_poke_batch_finish+0xb44/0x1130 arch/x86/kernel/alternative.c:2925 arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146 static_key_disable_cpuslocked+0xc5/0x1b0 kernel/jump_label.c:240 static_key_disable+0x1a/0x20 kernel/jump_label.c:248 toggle_allocation_gate+0x1a1/0x240 mm/kfence/core.c:855 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Allocated by task 5983: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:330 [inline] __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:356 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4180 [inline] slab_alloc_node mm/slub.c:4229 [inline] kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4236 xfrm_state_alloc+0x24/0x2f0 net/xfrm/xfrm_state.c:733 __find_acq_core+0x8a7/0x1c00 net/xfrm/xfrm_state.c:1833 xfrm_find_acq+0x78/0xa0 net/xfrm/xfrm_state.c:2353 xfrm_alloc_userspi+0x6b3/0xc90 net/xfrm/xfrm_user.c:1863 xfrm_user_rcv_msg+0x7a0/0xab0 net/xfrm/xfrm_user.c:3501 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 xfrm_netlink_rcv+0x79/0x90 net/xfrm/xfrm_user.c:3523 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 sock_sendmsg_nosec net/socket.c:714 [inline] __sock_sendmsg+0x21c/0x270 net/socket.c:729 ____sys_sendmsg+0x505/0x830 net/socket.c:2614 ___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668 __sys_sendmsg net/socket.c:2700 [inline] __do_sys_sendmsg net/socket.c:2705 [inline] __se_sys_sendmsg net/socket.c:2703 [inline] __x64_sys_sendmsg+0x19b/0x260 net/socket.c:2703 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 5976: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x46/0x50 mm/kasan/generic.c:576 poison_slab_object mm/kasan/common.c:243 [inline] __kasan_slab_free+0x5b/0x80 mm/kasan/common.c:275 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2417 [inline] slab_free mm/slub.c:4680 [inline] kmem_cache_free+0x18f/0x400 mm/slub.c:4782 xfrm_state_free net/xfrm/xfrm_state.c:591 [inline] xfrm_state_gc_destroy net/xfrm/xfrm_state.c:618 [inline] xfrm_state_gc_task+0x52d/0x6b0 net/xfrm/xfrm_state.c:634 process_one_work kernel/workqueue.c:3236 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x711/0x8a0 kernel/kthread.c:463 ret_from_fork+0x3f9/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 The buggy address belongs to the object at ffff888057310440 which belongs to the cache xfrm_state of size 928 The buggy address is located 48 bytes inside of freed 928-byte region [ffff888057310440, ffff8880573107e0) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888057311980 pfn:0x57310 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff888142aa0780 dead000000000122 0000000000000000 raw: ffff888057311980 00000000800f000e 00000000f5000000 0000000000000000 head: 00fff00000000040 ffff888142aa0780 dead000000000122 0000000000000000 head: ffff888057311980 00000000800f000e 00000000f5000000 0000000000000000 head: 00fff00000000002 ffffea00015cc401 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0x52820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 5983, tgid 5982 (syz.3.4), ts 99575633199, free_ts 99530888472 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2487 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2655 new_slab mm/slub.c:2709 [inline] ___slab_alloc+0xbeb/0x1410 mm/slub.c:3891 __slab_alloc mm/slub.c:3981 [inline] __slab_alloc_node mm/slub.c:4056 [inline] slab_alloc_node mm/slub.c:4217 [inline] kmem_cache_alloc_noprof+0x283/0x3c0 mm/slub.c:4236 xfrm_state_alloc+0x24/0x2f0 net/xfrm/xfrm_state.c:733 __find_acq_core+0x8a7/0x1c00 net/xfrm/xfrm_state.c:1833 xfrm_find_acq+0x78/0xa0 net/xfrm/xfrm_state.c:2353 xfrm_alloc_userspi+0x6b3/0xc90 net/xfrm/xfrm_user.c:1863 xfrm_user_rcv_msg+0x7a0/0xab0 net/xfrm/xfrm_user.c:3501 netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552 xfrm_netlink_rcv+0x79/0x90 net/xfrm/xfrm_user.c:3523 netlink_unicast_kernel net/netlink/af_netlink.c:1320 [inline] netlink_unicast+0x82c/0x9e0 net/netlink/af_netlink.c:1346 netlink_sendmsg+0x805/0xb30 net/netlink/af_netlink.c:1896 page last free pid 5982 tgid 5982 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1395 [inline] __free_frozen_pages+0xbc4/0xd30 mm/page_alloc.c:2895 stack_depot_save_flags+0x436/0x860 lib/stackdepot.c:727 kasan_save_stack mm/kasan/common.c:48 [inline] kasan_save_track+0x4f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4365 [inline] __kmalloc_node_noprof+0x276/0x4e0 mm/slub.c:4371 kmalloc_array_node_noprof include/linux/slab.h:1020 [inline] alloc_slab_obj_exts+0x39/0xa0 mm/slub.c:2028 __memcg_slab_post_alloc_hook+0x31e/0x7f0 mm/memcontrol.c:3174 memcg_slab_post_alloc_hook mm/slub.c:2216 [inline] slab_post_alloc_hook mm/slub.c:4190 [inline] slab_alloc_node mm/slub.c:4229 [inline] kmem_cache_alloc_noprof+0x2bf/0x3c0 mm/slub.c:4236 alloc_buffer_head+0x2a/0x270 fs/buffer.c:3025 folio_alloc_buffers+0x32d/0x640 fs/buffer.c:935 create_empty_buffers+0x3a/0x530 fs/buffer.c:1691 __block_write_begin_int+0x3b1/0x1900 fs/buffer.c:2126 block_page_mkwrite+0x34f/0x4d0 fs/buffer.c:2639 ext4_page_mkwrite+0xc87/0x1190 fs/ext4/inode.c:6725 do_page_mkwrite+0x14d/0x310 mm/memory.c:3361 do_shared_fault mm/memory.c:5649 [inline] do_fault mm/memory.c:5711 [inline] do_pte_missing mm/memory.c:4234 [inline] handle_pte_fault mm/memory.c:6052 [inline] __handle_mm_fault+0x1916/0x5440 mm/memory.c:6195 Memory state around the buggy address: ffff888057310300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057310380: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc >ffff888057310400: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff888057310480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888057310500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 45 8b 2c 24 mov (%r12),%r13d 4: 44 89 ee mov %r13d,%esi 7: 83 e6 01 and $0x1,%esi a: 31 ff xor %edi,%edi c: e8 b6 62 0b 00 call 0xb62c7 11: 41 83 e5 01 and $0x1,%r13d 15: 49 bd 00 00 00 00 00 movabs $0xdffffc0000000000,%r13 1c: fc ff df 1f: 75 07 jne 0x28 21: e8 61 5e 0b 00 call 0xb5e87 26: eb 38 jmp 0x60 28: f3 90 pause * 2a: 42 0f b6 04 2b movzbl (%rbx,%r13,1),%eax <-- trapping instruction 2f: 84 c0 test %al,%al 31: 75 11 jne 0x44 33: 41 f7 04 24 01 00 00 testl $0x1,(%r12) 3a: 00 3b: 74 1e je 0x5b 3d: e8 .byte 0xe8 3e: 45 5e rex.RB pop %r14