==================================================================
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 ffff888048c29df0 by task syz.1.3007/17669
CPU: 1 UID: 0 PID: 17669 Comm: syz.1.3007 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/18/2025
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_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:console_flush_all+0x7f7/0xc40 kernel/printk/printk.c:3227
Code: 48 21 c3 0f 85 e9 01 00 00 e8 65 49 1f 00 48 8b 5c 24 20 4d 85 f6 75 07 e8 56 49 1f 00 eb 06 e8 4f 49 1f 00 fb 48 8b 44 24 28 <42> 80 3c 20 00 74 08 48 89 df e8 1a bd 82 00 48 8b 1b 48 8b 44 24
RSP: 0018:ffffc9000c8c7300 EFLAGS: 00000287
RAX: 1ffffffff1d3686f RBX: ffffffff8e9b4378 RCX: 0000000000080000
RDX: ffffc9001d801000 RSI: 00000000000192ae RDI: 00000000000192af
RBP: ffffc9000c8c7450 R08: ffffffff8fa38f37 R09: 1ffffffff1f471e6
R10: dffffc0000000000 R11: fffffbfff1f471e7 R12: dffffc0000000000
R13: 0000000000000001 R14: 0000000000000200 R15: ffffffff8e9b4320
__console_flush_and_unlock kernel/printk/printk.c:3285 [inline]
console_unlock+0xc4/0x270 kernel/printk/printk.c:3325
vprintk_emit+0x5b7/0x7a0 kernel/printk/printk.c:2450
_printk+0xcf/0x120 kernel/printk/printk.c:2475
netdev_info+0x10a/0x160 net/core/dev.c:12702
netif_set_allmulti+0x1b8/0x380 net/core/dev.c:9477
dev_set_allmulti+0x12b/0x260 net/core/dev_api.c:313
ipmr_new_tunnel net/ipv4/ipmr.c:493 [inline]
vif_add+0xdfd/0x1420 net/ipv4/ipmr.c:862
ip_mroute_setsockopt+0xe12/0xf60 net/ipv4/ipmr.c:1456
do_ip_setsockopt+0xf11/0x2d00 net/ipv4/ip_sockglue.c:948
ip_setsockopt+0x66/0x110 net/ipv4/ip_sockglue.c:1417
do_sock_setsockopt+0x179/0x1b0 net/socket.c:2344
__sys_setsockopt net/socket.c:2369 [inline]
__do_sys_setsockopt net/socket.c:2375 [inline]
__se_sys_setsockopt net/socket.c:2372 [inline]
__x64_sys_setsockopt+0x13f/0x1b0 net/socket.c:2372
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
RIP: 0033:0x7f92e918eba9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f92ea03c038 EFLAGS: 00000246 ORIG_RAX: 0000000000000036
RAX: ffffffffffffffda RBX: 00007f92e93d5fa0 RCX: 00007f92e918eba9
RDX: 00000000000000ca RSI: 0000000000000000 RDI: 0000000000000004
RBP: 00007f92e9211e19 R08: 0000000000000010 R09: 0000000000000000
R10: 0000200000000140 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f92e93d6038 R14: 00007f92e93d5fa0 R15: 00007fff9c74b258
Allocated by task 16547:
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:4191 [inline]
slab_alloc_node mm/slub.c:4240 [inline]
kmem_cache_alloc_noprof+0x1c1/0x3c0 mm/slub.c:4247
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+0x7a3/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+0x82f/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 5995:
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:2422 [inline]
slab_free mm/slub.c:4695 [inline]
kmem_cache_free+0x18f/0x400 mm/slub.c:4797
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+0x70e/0x8a0 kernel/kthread.c:463
ret_from_fork+0x3fc/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 ffff888048c29dc0
which belongs to the cache xfrm_state of size 928
The buggy address is located 48 bytes inside of
freed 928-byte region [ffff888048c29dc0, ffff888048c2a160)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888048c29980 pfn:0x48c28
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 ffff888145ae78c0 dead000000000122 0000000000000000
raw: ffff888048c29980 00000000800f000b 00000000f5000000 0000000000000000
head: 00fff00000000040 ffff888145ae78c0 dead000000000122 0000000000000000
head: ffff888048c29980 00000000800f000b 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0001230a01 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 12331, tgid 12322 (syz.2.1588), ts 254640259767, free_ts 246883074041
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:2492 [inline]
allocate_slab+0x8a/0x370 mm/slub.c:2660
new_slab mm/slub.c:2714 [inline]
___slab_alloc+0xbeb/0x1420 mm/slub.c:3901
__slab_alloc mm/slub.c:3992 [inline]
__slab_alloc_node mm/slub.c:4067 [inline]
slab_alloc_node mm/slub.c:4228 [inline]
kmem_cache_alloc_noprof+0x283/0x3c0 mm/slub.c:4247
xfrm_state_alloc+0x24/0x2f0 net/xfrm/xfrm_state.c:733
xfrm_state_find+0x37d4/0x5400 net/xfrm/xfrm_state.c:1513
xfrm_tmpl_resolve_one net/xfrm/xfrm_policy.c:2522 [inline]
xfrm_tmpl_resolve net/xfrm/xfrm_policy.c:2573 [inline]
xfrm_resolve_and_create_bundle+0x768/0x2f80 net/xfrm/xfrm_policy.c:2871
xfrm_bundle_lookup net/xfrm/xfrm_policy.c:3106 [inline]
xfrm_lookup_with_ifid+0x58a/0x1a70 net/xfrm/xfrm_policy.c:3237
xfrm_lookup net/xfrm/xfrm_policy.c:3336 [inline]
xfrm_lookup_route+0x3c/0x1c0 net/xfrm/xfrm_policy.c:3347
udp_sendmsg+0x142e/0x2170 net/ipv4/udp.c:1450
sock_sendmsg_nosec net/socket.c:714 [inline]
__sock_sendmsg+0x19c/0x270 net/socket.c:729
____sys_sendmsg+0x52d/0x830 net/socket.c:2614
___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668
page last free pid 12047 tgid 12047 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
__folio_put+0x21b/0x2c0 mm/swap.c:112
put_netmem net/core/skbuff.c:7372 [inline]
skb_page_unref include/linux/skbuff_ref.h:43 [inline]
__skb_frag_unref include/linux/skbuff_ref.h:56 [inline]
skb_release_data+0x49a/0x7c0 net/core/skbuff.c:1080
skb_release_all net/core/skbuff.c:1151 [inline]
kfree_skb_add_bulk net/core/skbuff.c:1224 [inline]
kfree_skb_list_reason+0x25d/0x460 net/core/skbuff.c:1246
skb_release_data+0x61e/0x7c0 net/core/skbuff.c:1084
skb_release_all net/core/skbuff.c:1151 [inline]
__kfree_skb net/core/skbuff.c:1165 [inline]
sk_skb_reason_drop+0x127/0x170 net/core/skbuff.c:1203
kfree_skb_reason include/linux/skbuff.h:1316 [inline]
kfree_skb include/linux/skbuff.h:1325 [inline]
kcm_release+0x177/0x5b0 net/kcm/kcmsock.c:1688
__sock_release net/socket.c:649 [inline]
sock_close+0xc3/0x240 net/socket.c:1439
__fput+0x44c/0xa70 fs/file_table.c:468
task_work_run+0x1d1/0x260 kernel/task_work.c:227
resume_user_mode_work include/linux/resume_user_mode.h:50 [inline]
exit_to_user_mode_loop+0xec/0x110 kernel/entry/common.c:43
exit_to_user_mode_prepare include/linux/irq-entry-common.h:225 [inline]
syscall_exit_to_user_mode_work include/linux/entry-common.h:175 [inline]
syscall_exit_to_user_mode include/linux/entry-common.h:210 [inline]
do_syscall_64+0x2bd/0x3b0 arch/x86/entry/syscall_64.c:100
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Memory state around the buggy address:
ffff888048c29c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888048c29d00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888048c29d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb
^
ffff888048c29e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888048c29e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 48 21 c3 and %rax,%rbx
3: 0f 85 e9 01 00 00 jne 0x1f2
9: e8 65 49 1f 00 call 0x1f4973
e: 48 8b 5c 24 20 mov 0x20(%rsp),%rbx
13: 4d 85 f6 test %r14,%r14
16: 75 07 jne 0x1f
18: e8 56 49 1f 00 call 0x1f4973
1d: eb 06 jmp 0x25
1f: e8 4f 49 1f 00 call 0x1f4973
24: fb sti
25: 48 8b 44 24 28 mov 0x28(%rsp),%rax
* 2a: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) <-- trapping instruction
2f: 74 08 je 0x39
31: 48 89 df mov %rbx,%rdi
34: e8 1a bd 82 00 call 0x82bd53
39: 48 8b 1b mov (%rbx),%rbx
3c: 48 rex.W
3d: 8b .byte 0x8b
3e: 44 rex.R
3f: 24 .byte 0x24