[v6.6] KASAN: slab-out-of-bounds Read in __xfrm_decode_session

0 views
Skip to first unread message

syzbot

unread,
6:21 AM (11 hours ago) 6:21 AM
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4fc00fe35d46 Linux 6.6.129
git tree: linux-6.6.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12b45e02580000
kernel config: https://syzkaller.appspot.com/x/.config?x=c5b35c4db8465904
dashboard link: https://syzkaller.appspot.com/bug?extid=3df7d934c08936248f4d
compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16cd81d6580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=1328e6da580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/b69a43016252/disk-4fc00fe3.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/240ac8d2cf70/vmlinux-4fc00fe3.xz
kernel image: https://storage.googleapis.com/syzbot-assets/67c7958e5edb/bzImage-4fc00fe3.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3df7d9...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: slab-out-of-bounds in decode_session6 net/xfrm/xfrm_policy.c:3494 [inline]
BUG: KASAN: slab-out-of-bounds in __xfrm_decode_session+0x18d7/0x20a0 net/xfrm/xfrm_policy.c:3600
Read of size 1 at addr ffff8880780b2ff8 by task syz.0.17/5921

CPU: 0 PID: 5921 Comm: syz.0.17 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026
Call Trace:
<TASK>
dump_stack_lvl+0x18c/0x250 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:364 [inline]
print_report+0xa8/0x210 mm/kasan/report.c:468
kasan_report+0x117/0x150 mm/kasan/report.c:581
decode_session6 net/xfrm/xfrm_policy.c:3494 [inline]
__xfrm_decode_session+0x18d7/0x20a0 net/xfrm/xfrm_policy.c:3600
xfrm_decode_session_reverse include/net/xfrm.h:1237 [inline]
icmpv6_route_lookup+0x442/0x600 net/ipv6/icmp.c:392
icmp6_send+0x11a2/0x1b40 net/ipv6/icmp.c:604
__icmpv6_send include/linux/icmpv6.h:28 [inline]
icmpv6_send include/linux/icmpv6.h:49 [inline]
ip6_link_failure+0x3b/0x4c0 net/ipv6/route.c:2835
dst_link_failure include/net/dst.h:437 [inline]
ip6_tnl_xmit+0xe8b/0x2a80 net/ipv6/ip6_tunnel.c:1282
ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1398 [inline]
ip6_tnl_start_xmit+0xc6c/0x11c0 net/ipv6/ip6_tunnel.c:1446
__netdev_start_xmit include/linux/netdevice.h:4943 [inline]
netdev_start_xmit include/linux/netdevice.h:4957 [inline]
xmit_one net/core/dev.c:3632 [inline]
dev_hard_start_xmit+0x246/0x740 net/core/dev.c:3648
sch_direct_xmit+0x25e/0x4c0 net/sched/sch_generic.c:345
qdisc_restart net/sched/sch_generic.c:410 [inline]
__qdisc_run+0xa56/0x1500 net/sched/sch_generic.c:418
__dev_xmit_skb net/core/dev.c:3932 [inline]
__dev_queue_xmit+0x10ad/0x3660 net/core/dev.c:4404
neigh_output include/net/neighbour.h:543 [inline]
ip6_finish_output2+0xe3d/0x1630 net/ipv6/ip6_output.c:141
ip6_fragment+0x1535/0x1fd0 net/ipv6/ip6_output.c:1023
dst_output include/net/dst.h:467 [inline]
NF_HOOK include/linux/netfilter.h:304 [inline]
ip6_xmit+0x10f1/0x1890 net/ipv6/ip6_output.c:360
sctp_v6_xmit+0x9a4/0x1200 net/sctp/ipv6.c:250
sctp_packet_transmit+0x247d/0x2a30 net/sctp/output.c:653
sctp_packet_singleton+0x235/0x340 net/sctp/outqueue.c:783
sctp_outq_flush_ctrl net/sctp/outqueue.c:914 [inline]
sctp_outq_flush+0x50e/0x3120 net/sctp/outqueue.c:1212
sctp_cmd_interpreter net/sctp/sm_sideeffect.c:-1 [inline]
sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline]
sctp_do_sm+0x533b/0x5a60 net/sctp/sm_sideeffect.c:1169
sctp_primitive_ASSOCIATE+0x95/0xc0 net/sctp/primitive.c:73
sctp_sendmsg_to_asoc+0x10a6/0x1830 net/sctp/socket.c:1839
sctp_sendmsg+0x1b83/0x28c0 net/sctp/socket.c:2029
sock_sendmsg_nosec net/socket.c:730 [inline]
__sock_sendmsg net/socket.c:745 [inline]
__sys_sendto+0x4a9/0x6b0 net/socket.c:2200
__do_sys_sendto net/socket.c:2212 [inline]
__se_sys_sendto net/socket.c:2208 [inline]
__x64_sys_sendto+0xde/0xf0 net/socket.c:2208
do_syscall_x64 arch/x86/entry/common.c:46 [inline]
do_syscall_64+0x55/0xa0 arch/x86/entry/common.c:76
entry_SYSCALL_64_after_hwframe+0x68/0xd2
RIP: 0033:0x7fd11b99c799
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffeaaa454a8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c
RAX: ffffffffffffffda RBX: 00007fd11bc15fa0 RCX: 00007fd11b99c799
RDX: 0000000000000001 RSI: 0000200000000240 RDI: 0000000000000005
RBP: 00007fd11ba32c99 R08: 0000200000000080 R09: 000000000000001c
R10: 0000000000000051 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fd11bc15fac R14: 00007fd11bc15fa0 R15: 00007fd11bc15fa0
</TASK>

The buggy address belongs to the object at ffff8880780b2000
which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 2040 bytes to the right of
allocated 2048-byte region [ffff8880780b2000, ffff8880780b2800)

The buggy address belongs to the physical page:
page:ffffea0001e02c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x780b0
head:ffffea0001e02c00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff)
page_type: 0xffffffff()
raw: 00fff00000000840 ffff888017c42000 dead000000000122 0000000000000000
raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 5921, tgid 5921 (syz.0.17), ts 96101012200, free_ts 95968154510
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook+0x1c1/0x200 mm/page_alloc.c:1581
prep_new_page mm/page_alloc.c:1588 [inline]
get_page_from_freelist+0x1951/0x19e0 mm/page_alloc.c:3220
__alloc_pages+0x1f0/0x460 mm/page_alloc.c:4500
alloc_slab_page+0x5d/0x160 mm/slub.c:1881
allocate_slab mm/slub.c:2028 [inline]
new_slab+0x87/0x2d0 mm/slub.c:2081
___slab_alloc+0xc5d/0x12f0 mm/slub.c:3253
__slab_alloc mm/slub.c:3339 [inline]
__slab_alloc_node mm/slub.c:3392 [inline]
slab_alloc_node mm/slub.c:3485 [inline]
__kmem_cache_alloc_node+0x19e/0x250 mm/slub.c:3534
__do_kmalloc_node mm/slab_common.c:1006 [inline]
__kmalloc_node_track_caller+0xa2/0x230 mm/slab_common.c:1027
kmalloc_reserve+0x116/0x240 net/core/skbuff.c:584
pskb_expand_head+0x185/0x1230 net/core/skbuff.c:2103
nf_nat_icmpv6_reply_translation+0x144/0xa00 net/netfilter/nf_nat_proto.c:853
nf_nat_ipv6_fn+0x1f6/0x2e0 net/netfilter/nf_nat_proto.c:928
nf_nat_ipv6_in+0xfd/0x2b0 net/netfilter/nf_nat_proto.c:947
nf_hook_entry_hookfn include/linux/netfilter.h:144 [inline]
nf_hook_slow+0xbd/0x200 net/netfilter/core.c:626
nf_hook include/linux/netfilter.h:259 [inline]
NF_HOOK+0x21d/0x3b0 include/linux/netfilter.h:302
__netif_receive_skb_one_core net/core/dev.c:5634 [inline]
__netif_receive_skb+0xcc/0x290 net/core/dev.c:5748
page last free stack trace:
reset_page_owner include/linux/page_owner.h:24 [inline]
free_pages_prepare mm/page_alloc.c:1181 [inline]
free_unref_page_prepare+0x7b2/0x8c0 mm/page_alloc.c:2365
free_unref_page+0x32/0x2e0 mm/page_alloc.c:2458
discard_slab mm/slub.c:2127 [inline]
__unfreeze_partials+0x1cf/0x210 mm/slub.c:2667
put_cpu_partial+0x17c/0x250 mm/slub.c:2743
__slab_free+0x319/0x400 mm/slub.c:3700
qlink_free mm/kasan/quarantine.c:166 [inline]
qlist_free_all+0x75/0xd0 mm/kasan/quarantine.c:185
kasan_quarantine_reduce+0x143/0x160 mm/kasan/quarantine.c:292
__kasan_slab_alloc+0x22/0x80 mm/kasan/common.c:306
kasan_slab_alloc include/linux/kasan.h:188 [inline]
slab_post_alloc_hook+0x6e/0x4b0 mm/slab.h:767
slab_alloc_node mm/slub.c:3495 [inline]
kmem_cache_alloc_node+0x14c/0x320 mm/slub.c:3540
__alloc_skb+0x103/0x2c0 net/core/skbuff.c:643
alloc_skb include/linux/skbuff.h:1316 [inline]
nlmsg_new include/net/netlink.h:1010 [inline]
mpls_netconf_notify_devconf+0x46/0xf0 net/mpls/af_mpls.c:1189
mpls_dev_notify+0x533/0x7a0 net/mpls/af_mpls.c:1643
notifier_call_chain+0x197/0x380 kernel/notifier.c:93
call_netdevice_notifiers_extack net/core/dev.c:2077 [inline]
call_netdevice_notifiers net/core/dev.c:2091 [inline]
unregister_netdevice_many_notify+0x100d/0x1900 net/core/dev.c:11112
ip6gre_exit_batch_net+0x451/0x4a0 net/ipv6/ip6_gre.c:1654

Memory state around the buggy address:
ffff8880780b2e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880780b2f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8880780b2f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8880780b3000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8880780b3080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages