syzbot


KASAN: slab-out-of-bounds Read in __xfrm_decode_session (2)

Status: upstream: reported on 2025/03/30 08:54
Reported-by: syzbot+b7fd2685e7d9ce85ae1a@syzkaller.appspotmail.com
First crash: 107d, last: 27d
Similar bugs (10)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-6.6 KASAN: slab-use-after-free Read in __xfrm_decode_session 19 10 14h26m 14d 0/2 upstream: reported on 2025/07/01 19:37
linux-6.1 KASAN: use-after-free Read in __xfrm_decode_session (2) origin:lts-only 19 C 7 14d 76d 0/3 upstream: reported C repro on 2025/04/30 13:03
upstream KASAN: slab-out-of-bounds Read in __xfrm_decode_session (2) net 19 7 1318d 1554d 0/29 auto-closed as invalid on 2022/04/04 17:22
upstream KMSAN: kernel-infoleak in copyout (2) net 17 C 6723 768d 1937d 22/29 fixed on 2023/06/08 14:41
linux-5.15 KASAN: slab-out-of-bounds Read in __xfrm_decode_session origin:upstream 19 C error 7 614d 801d 0/3 auto-obsoleted due to no activity on 2024/02/16 23:16
linux-6.1 KASAN: slab-out-of-bounds Read in __xfrm_decode_session 17 1 201d 201d 0/3 auto-obsoleted due to no activity on 2025/04/05 09:29
upstream KASAN: slab-out-of-bounds Read in __xfrm_decode_session net 17 20 1770d 2055d 0/29 auto-closed as invalid on 2021/01/07 14:52
linux-6.1 KASAN: use-after-free Read in __xfrm_decode_session 19 4 660d 792d 0/3 auto-obsoleted due to no activity on 2024/01/01 21:03
upstream KMSAN: kernel-infoleak in _copy_to_iter (7) net 23 C 138977 872d 1224d 22/29 fixed on 2023/02/24 13:50
upstream KMSAN: uninit-value in __xfrm_decode_session (4) net 19 C 8 632d 679d 0/29 closed as invalid on 2023/12/14 11:46

Sample crash report:
==================================================================
BUG: KASAN: slab-out-of-bounds in decode_session6 net/xfrm/xfrm_policy.c:3413 [inline]
BUG: KASAN: slab-out-of-bounds in __xfrm_decode_session+0x140c/0x1ad4 net/xfrm/xfrm_policy.c:3520
Read of size 1 at addr ffff0000e5dae7ed by task syz.2.40/4227

CPU: 0 PID: 4227 Comm: syz.2.40 Not tainted 5.15.185-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call trace:
 dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152
 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216
 __dump_stack+0x30/0x40 lib/dump_stack.c:88
 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106
 print_address_description+0x78/0x30c mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xec/0x15c mm/kasan/report.c:451
 __asan_report_load1_noabort+0x44/0x50 mm/kasan/report_generic.c:306
 decode_session6 net/xfrm/xfrm_policy.c:3413 [inline]
 __xfrm_decode_session+0x140c/0x1ad4 net/xfrm/xfrm_policy.c:3520
 xfrm_decode_session_reverse include/net/xfrm.h:1177 [inline]
 icmpv6_route_lookup+0x310/0x470 net/ipv6/icmp.c:394
 icmp6_send+0xbd0/0x144c net/ipv6/icmp.c:601
 __icmpv6_send include/linux/icmpv6.h:28 [inline]
 icmpv6_send include/linux/icmpv6.h:49 [inline]
 ip6_link_failure+0x44/0x4a8 net/ipv6/route.c:2788
 dst_link_failure include/net/dst.h:422 [inline]
 ip6_tnl_xmit+0x6d4/0x20b4 net/ipv6/ip6_tunnel.c:1275
 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1391 [inline]
 ip6_tnl_start_xmit+0xba0/0x10cc net/ipv6/ip6_tunnel.c:1440
 __netdev_start_xmit include/linux/netdevice.h:5027 [inline]
 netdev_start_xmit include/linux/netdevice.h:5041 [inline]
 xmit_one net/core/dev.c:3649 [inline]
 dev_hard_start_xmit+0x2a8/0x87c net/core/dev.c:3665
 sch_direct_xmit+0x2a4/0x3bc net/sched/sch_generic.c:342
 qdisc_restart net/sched/sch_generic.c:407 [inline]
 __qdisc_run+0x85c/0x1170 net/sched/sch_generic.c:415
 __dev_xmit_skb net/core/dev.c:3942 [inline]
 __dev_queue_xmit+0xfe0/0x2800 net/core/dev.c:4253
 dev_queue_xmit+0x24/0x34 net/core/dev.c:4321
 neigh_connected_output+0x32c/0x370 net/core/neighbour.c:1533
 neigh_output include/net/neighbour.h:509 [inline]
 ip6_finish_output2+0x12d0/0x1a14 net/ipv6/ip6_output.c:130
 ip6_fragment+0x14c8/0x22e4 net/ipv6/ip6_output.c:998
 __ip6_finish_output+0x550/0x6dc net/ipv6/ip6_output.c:199
 ip6_finish_output+0x40/0x218 net/ipv6/ip6_output.c:211
 NF_HOOK_COND include/linux/netfilter.h:291 [inline]
 ip6_output+0x274/0x500 net/ipv6/ip6_output.c:234
 dst_output include/net/dst.h:452 [inline]
 NF_HOOK include/linux/netfilter.h:302 [inline]
 ip6_xmit+0x112c/0x188c net/ipv6/ip6_output.c:338
 sctp_v6_xmit+0x84c/0xf80 net/sctp/ipv6.c:250
 sctp_packet_transmit+0x1da0/0x2254 net/sctp/output.c:652
 sctp_packet_singleton+0x1d0/0x2bc net/sctp/outqueue.c:780
 sctp_outq_flush_ctrl net/sctp/outqueue.c:911 [inline]
 sctp_outq_flush+0x404/0x27b8 net/sctp/outqueue.c:1209
 sctp_outq_uncork+0x84/0xc0 net/sctp/outqueue.c:761
 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:-1 [inline]
 sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline]
 sctp_do_sm+0x427c/0x4894 net/sctp/sm_sideeffect.c:1170
 sctp_primitive_ASSOCIATE+0x98/0xc8 net/sctp/primitive.c:73
 sctp_sendmsg_to_asoc+0x1440/0x183c net/sctp/socket.c:1842
 sctp_sendmsg+0x134c/0x2048 net/sctp/socket.c:2032
 inet_sendmsg+0x154/0x284 net/ipv4/af_inet.c:834
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 ____sys_sendmsg+0x61c/0x920 net/socket.c:2436
 ___sys_sendmsg+0x1d0/0x240 net/socket.c:2490
 __sys_sendmmsg+0x218/0x5f0 net/socket.c:2576
 __do_sys_sendmmsg net/socket.c:2605 [inline]
 __se_sys_sendmmsg net/socket.c:2602 [inline]
 __arm64_sys_sendmmsg+0xa0/0xbc net/socket.c:2602
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

Allocated by task 4027:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 ____kasan_kmalloc mm/kasan/common.c:513 [inline]
 __kasan_kmalloc+0xb0/0xf0 mm/kasan/common.c:522
 kasan_kmalloc include/linux/kasan.h:264 [inline]
 __kmalloc+0x298/0x44c mm/slub.c:4407
 kmalloc include/linux/slab.h:609 [inline]
 kzalloc include/linux/slab.h:735 [inline]
 __register_sysctl_table+0xd4/0xfb0 fs/proc/proc_sysctl.c:1320
 register_net_sysctl+0x2e4/0x330 net/sysctl_net.c:169
 __addrconf_sysctl_register+0x20c/0x35c net/ipv6/addrconf.c:7107
 addrconf_sysctl_register+0x140/0x194 net/ipv6/addrconf.c:7154
 ipv6_add_dev+0x930/0xe40 net/ipv6/addrconf.c:454
 addrconf_notify+0x53c/0xc6c net/ipv6/addrconf.c:3582
 notifier_call_chain kernel/notifier.c:83 [inline]
 raw_notifier_call_chain+0xd4/0x164 kernel/notifier.c:391
 call_netdevice_notifiers_info net/core/dev.c:2049 [inline]
 call_netdevice_notifiers_extack net/core/dev.c:2061 [inline]
 call_netdevice_notifiers+0x10c/0x18c net/core/dev.c:2075
 register_netdevice+0xf04/0x1304 net/core/dev.c:10428
 veth_newlink+0x4d0/0xb88 drivers/net/veth.c:1683
 __rtnl_newlink net/core/rtnetlink.c:3524 [inline]
 rtnl_newlink+0xeac/0x1404 net/core/rtnetlink.c:3572
 rtnetlink_rcv_msg+0x9d4/0xd04 net/core/rtnetlink.c:5650
 netlink_rcv_skb+0x208/0x3c4 net/netlink/af_netlink.c:2489
 rtnetlink_rcv+0x28/0x38 net/core/rtnetlink.c:5668
 netlink_unicast_kernel net/netlink/af_netlink.c:1311 [inline]
 netlink_unicast+0x60c/0x89c net/netlink/af_netlink.c:1337
 netlink_sendmsg+0x6e8/0x9cc net/netlink/af_netlink.c:1905
 sock_sendmsg_nosec net/socket.c:704 [inline]
 __sock_sendmsg net/socket.c:716 [inline]
 __sys_sendto+0x2e8/0x3d8 net/socket.c:2063
 __do_sys_sendto net/socket.c:2075 [inline]
 __se_sys_sendto net/socket.c:2071 [inline]
 __arm64_sys_sendto+0xd8/0xf8 net/socket.c:2071
 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline]
 invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52
 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142
 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181
 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608
 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626
 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584

The buggy address belongs to the object at ffff0000e5dae000
 which belongs to the cache kmalloc-2k of size 2048
The buggy address is located 2029 bytes inside of
 2048-byte region [ffff0000e5dae000, ffff0000e5dae800)
The buggy address belongs to the page:
page:00000000d4ef3fbe refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x125da8
head:00000000d4ef3fbe order:3 compound_mapcount:0 compound_pincount:0
flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff)
raw: 05ffc00000010200 fffffc000396fa00 0000000200000002 ffff0000c0002900
raw: 0000000000000000 0000000080080008 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff0000e5dae680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 ffff0000e5dae700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc
>ffff0000e5dae780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
                                                          ^
 ffff0000e5dae800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff0000e5dae880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/06/17 23:06 linux-5.15.y 1c700860e8bc e77fae15 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in __xfrm_decode_session
2025/05/24 06:49 linux-5.15.y 98f47d0e9b8c ed351ea7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in __xfrm_decode_session
2025/03/30 08:53 linux-5.15.y 0c935c049b5c d3999433 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: slab-out-of-bounds Read in __xfrm_decode_session
* Struck through repros no longer work on HEAD.