==================================================================
BUG: KASAN: slab-out-of-bounds in __xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline]
BUG: KASAN: slab-out-of-bounds in xfrm_state_find+0x2cf2/0x5400 net/xfrm/xfrm_state.c:1494
Read of size 1 at addr ffff88806d1d0330 by task syz.2.3266/17579
CPU: 1 UID: 0 PID: 17579 Comm: syz.2.3266 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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
__xfrm_state_lookup_all net/xfrm/xfrm_state.c:-1 [inline]
xfrm_state_find+0x2cf2/0x5400 net/xfrm/xfrm_state.c:1494
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
ip_route_output_key include/net/route.h:179 [inline]
tipc_udp_xmit+0x1c3/0xb60 net/tipc/udp_media.c:189
tipc_udp_send_msg+0x27f/0x3f0 net/tipc/udp_media.c:271
tipc_bearer_xmit_skb+0x2b0/0x400 net/tipc/bearer.c:575
tipc_disc_timeout+0x580/0x6d0 net/tipc/discover.c:338
call_timer_fn+0x17e/0x5f0 kernel/time/timer.c:1747
expire_timers kernel/time/timer.c:1798 [inline]
__run_timers kernel/time/timer.c:2372 [inline]
__run_timer_base+0x61a/0x860 kernel/time/timer.c:2384
run_timer_base kernel/time/timer.c:2393 [inline]
run_timer_softirq+0xb7/0x180 kernel/time/timer.c:2403
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:free_pages_and_swap_cache+0x10c/0x520 mm/swap_state.c:255
Code: 8d 44 24 60 48 83 c0 08 48 89 44 24 38 49 63 cf 48 8b 44 24 28 48 89 4c 24 30 48 8d 1c c8 49 89 dc 49 c1 ec 03 43 80 3c 2c 00 <74> 08 48 89 df e8 ea bd 08 00 4c 8b 2b 4c 89 e8 48 83 e0 fc 48 89
RSP: 0018:ffffc900043ef2e0 EFLAGS: 00000246
RAX: ffff888068d2f010 RBX: ffff888068d2f030 RCX: 0000000000000004
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 000000000000001f
RBP: ffffc900043ef568 R08: ffffea0001757c07 R09: 1ffffd40002eaf80
R10: dffffc0000000000 R11: fffff940002eaf81 R12: 1ffff1100d1a5e06
R13: dffffc0000000000 R14: 0000000000000004 R15: 0000000000000004
__tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline]
tlb_batch_pages_flush mm/mmu_gather.c:149 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:397 [inline]
tlb_flush_mmu+0x3a0/0x680 mm/mmu_gather.c:404
zap_pte_range mm/memory.c:1765 [inline]
zap_pmd_range mm/memory.c:1818 [inline]
zap_pud_range mm/memory.c:1847 [inline]
zap_p4d_range mm/memory.c:1868 [inline]
unmap_page_range+0x3b31/0x4370 mm/memory.c:1889
unmap_single_vma mm/memory.c:1932 [inline]
unmap_vmas+0x399/0x580 mm/memory.c:1976
exit_mmap+0x248/0xb50 mm/mmap.c:1280
__mmput+0x118/0x420 kernel/fork.c:1130
exit_mm+0x1da/0x2c0 kernel/exit.c:582
do_exit+0x648/0x2300 kernel/exit.c:949
do_group_exit+0x21c/0x2d0 kernel/exit.c:1102
__do_sys_exit_group kernel/exit.c:1113 [inline]
__se_sys_exit_group kernel/exit.c:1111 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:1111
x64_sys_call+0x21f7/0x2200 arch/x86/include/generated/asm/syscalls_64.h:232
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:0x7fdda358ebe9
Code: Unable to access opcode bytes at 0x7fdda358ebbf.
RSP: 002b:00007ffdd58590c8 EFLAGS: 00000246 ORIG_RAX: 00000000000000e7
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007fdda358ebe9
RDX: 0000000000000064 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007ffdd585912c R08: 0000000cd58591bf R09: 00000000000927c0
R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000013
R13: 00000000000927c0 R14: 0000000000065d26 R15: 00007ffdd5859180
Allocated by task 15640:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/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]
__kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4407
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1039 [inline]
mca_alloc net/ipv6/mcast.c:871 [inline]
__ipv6_dev_mc_inc+0x44f/0xa50 net/ipv6/mcast.c:961
ipv6_add_dev+0xe54/0x1370 net/ipv6/addrconf.c:472
addrconf_notify+0x794/0x1010 net/ipv6/addrconf.c:3650
notifier_call_chain+0x1b3/0x3e0 kernel/notifier.c:85
call_netdevice_notifiers_extack net/core/dev.c:2267 [inline]
call_netdevice_notifiers net/core/dev.c:2281 [inline]
register_netdevice+0x1608/0x1ae0 net/core/dev.c:11293
macsec_newlink+0x6be/0x11b0 drivers/net/macsec.c:4156
rtnl_newlink_create+0x30d/0xb00 net/core/rtnetlink.c:3825
__rtnl_newlink net/core/rtnetlink.c:3942 [inline]
rtnl_newlink+0x16d6/0x1c70 net/core/rtnetlink.c:4057
rtnetlink_rcv_msg+0x7cc/0xb70 net/core/rtnetlink.c:6946
netlink_rcv_skb+0x208/0x470 net/netlink/af_netlink.c:2552
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_sendto+0x3bd/0x520 net/socket.c:2228
__do_sys_sendto net/socket.c:2235 [inline]
__se_sys_sendto net/socket.c:2231 [inline]
__x64_sys_sendto+0xde/0x100 net/socket.c:2231
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
The buggy address belongs to the object at ffff88806d1d0000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 528 bytes to the right of
allocated 288-byte region [ffff88806d1d0000, ffff88806d1d0120)
The buggy address belongs to the physical page:
page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88806d1d3400 pfn:0x6d1d0
head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: f5(slab)
raw: 00fff00000000240 ffff88801a441c80 ffffea0001b15810 ffffea0001547a10
raw: ffff88806d1d3400 0000000000100005 00000000f5000000 0000000000000000
head: 00fff00000000240 ffff88801a441c80 ffffea0001b15810 ffffea0001547a10
head: ffff88806d1d3400 0000000000100005 00000000f5000000 0000000000000000
head: 00fff00000000002 ffffea0001b47401 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 11734, tgid 11732 (syz.3.1449), ts 246638426123, free_ts 230654394460
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]
__do_kmalloc_node mm/slub.c:4375 [inline]
__kmalloc_node_track_caller_noprof+0x2f8/0x4e0 mm/slub.c:4395
kmemdup_noprof+0x2b/0x70 mm/util.c:138
kmemdup_noprof include/linux/fortify-string.h:765 [inline]
cache_create_net+0x2f/0x260 net/sunrpc/cache.c:1743
rsc_cache_create_net net/sunrpc/auth_gss/svcauth_gss.c:2053 [inline]
gss_svc_init_net+0x58/0x570 net/sunrpc/auth_gss/svcauth_gss.c:2081
ops_init+0x35c/0x5c0 net/core/net_namespace.c:136
setup_net+0x10c/0x320 net/core/net_namespace.c:438
copy_net_ns+0x31b/0x4d0 net/core/net_namespace.c:570
create_new_namespaces+0x3f3/0x720 kernel/nsproxy.c:110
unshare_nsproxy_namespaces+0x11c/0x170 kernel/nsproxy.c:218
ksys_unshare+0x4c8/0x8c0 kernel/fork.c:3127
page last free pid 11034 tgid 11025 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
__slab_free+0x303/0x3c0 mm/slub.c:4606
qlink_free mm/kasan/quarantine.c:163 [inline]
qlist_free_all+0x97/0x140 mm/kasan/quarantine.c:179
kasan_quarantine_reduce+0x148/0x160 mm/kasan/quarantine.c:286
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:340
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_node_noprof+0x1bb/0x3c0 mm/slub.c:4292
__alloc_skb+0x112/0x2d0 net/core/skbuff.c:659
alloc_skb include/linux/skbuff.h:1377 [inline]
alloc_skb_with_frags+0xca/0x890 net/core/skbuff.c:6667
sock_alloc_send_pskb+0x857/0x990 net/core/sock.c:2965
sock_alloc_send_skb include/net/sock.h:1856 [inline]
llc_ui_sendmsg+0x477/0xdd0 net/llc/af_llc.c:970
sock_sendmsg_nosec net/socket.c:714 [inline]
__sock_sendmsg+0x21c/0x270 net/socket.c:729
____sys_sendmsg+0x52d/0x830 net/socket.c:2614
___sys_sendmsg+0x21f/0x2a0 net/socket.c:2668
__sys_sendmmsg+0x227/0x430 net/socket.c:2757
__do_sys_sendmmsg net/socket.c:2784 [inline]
__se_sys_sendmmsg net/socket.c:2781 [inline]
__x64_sys_sendmmsg+0xa0/0xc0 net/socket.c:2781
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
Memory state around the buggy address:
ffff88806d1d0200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88806d1d0280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff88806d1d0300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff88806d1d0380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88806d1d0400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================
----------------
Code disassembly (best guess):
0: 8d 44 24 60 lea 0x60(%rsp),%eax
4: 48 83 c0 08 add $0x8,%rax
8: 48 89 44 24 38 mov %rax,0x38(%rsp)
d: 49 63 cf movslq %r15d,%rcx
10: 48 8b 44 24 28 mov 0x28(%rsp),%rax
15: 48 89 4c 24 30 mov %rcx,0x30(%rsp)
1a: 48 8d 1c c8 lea (%rax,%rcx,8),%rbx
1e: 49 89 dc mov %rbx,%r12
21: 49 c1 ec 03 shr $0x3,%r12
25: 43 80 3c 2c 00 cmpb $0x0,(%r12,%r13,1)
* 2a: 74 08 je 0x34 <-- trapping instruction
2c: 48 89 df mov %rbx,%rdi
2f: e8 ea bd 08 00 call 0x8be1e
34: 4c 8b 2b mov (%rbx),%r13
37: 4c 89 e8 mov %r13,%rax
3a: 48 83 e0 fc and $0xfffffffffffffffc,%rax
3e: 48 rex.W
3f: 89 .byte 0x89