================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6 net/xfrm/xfrm_policy.c:3415 [inline] BUG: KASAN: slab-out-of-bounds in __xfrm_decode_session+0x14c4/0x1b8c net/xfrm/xfrm_policy.c:3521 Read of size 1 at addr ffff0000d87a33ad by task syz.3.1079/8990 CPU: 0 PID: 8990 Comm: syz.3.1079 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/03/2025 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 print_address_description+0x88/0x218 mm/kasan/report.c:316 print_report+0x50/0x68 mm/kasan/report.c:420 kasan_report+0xa8/0x100 mm/kasan/report.c:524 __asan_report_load1_noabort+0x2c/0x38 mm/kasan/report_generic.c:348 decode_session6 net/xfrm/xfrm_policy.c:3415 [inline] __xfrm_decode_session+0x14c4/0x1b8c net/xfrm/xfrm_policy.c:3521 xfrm_decode_session_reverse include/net/xfrm.h:1183 [inline] icmpv6_route_lookup+0x310/0x470 net/ipv6/icmp.c:394 icmp6_send+0xb98/0x13e4 net/ipv6/icmp.c:603 __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:2827 dst_link_failure include/net/dst.h:423 [inline] ip6_tnl_xmit+0xed8/0x2454 net/ipv6/ip6_tunnel.c:1283 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1399 [inline] ip6_tnl_start_xmit+0xb88/0x1088 net/ipv6/ip6_tunnel.c:1448 __netdev_start_xmit include/linux/netdevice.h:4896 [inline] netdev_start_xmit include/linux/netdevice.h:4910 [inline] xmit_one net/core/dev.c:3670 [inline] dev_hard_start_xmit+0x244/0x8e0 net/core/dev.c:3686 sch_direct_xmit+0x204/0x480 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x8c0/0x1368 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3970 [inline] __dev_queue_xmit+0xc18/0x309c net/core/dev.c:4312 dev_queue_xmit include/linux/netdevice.h:3051 [inline] neigh_connected_output+0x358/0x3e8 net/core/neighbour.c:1597 neigh_output include/net/neighbour.h:545 [inline] ip6_finish_output2+0xd60/0x1844 net/ipv6/ip6_output.c:138 ip6_fragment+0x19ac/0x247c net/ipv6/ip6_output.c:960 __ip6_finish_output net/ipv6/ip6_output.c:203 [inline] ip6_finish_output+0x444/0x930 net/ipv6/ip6_output.c:216 NF_HOOK_COND include/linux/netfilter.h:291 [inline] ip6_output+0x274/0x500 net/ipv6/ip6_output.c:237 dst_output include/net/dst.h:453 [inline] ip6_local_out+0x120/0x15c net/ipv6/output_core.c:161 ip6_send_skb+0x1a0/0x4e4 net/ipv6/ip6_output.c:2009 udp_v6_send_skb+0x9f0/0x1608 net/ipv6/udp.c:1305 udpv6_sendmsg+0x14cc/0x1f9c net/ipv6/udp.c:1600 inet6_sendmsg+0xb4/0xd8 net/ipv6/af_inet6.c:668 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] ____sys_sendmsg+0x5b8/0x918 net/socket.c:2519 ___sys_sendmsg net/socket.c:2573 [inline] __sys_sendmsg+0x25c/0x320 net/socket.c:2602 __do_sys_sendmsg net/socket.c:2611 [inline] __se_sys_sendmsg net/socket.c:2609 [inline] __arm64_sys_sendmsg+0x80/0x94 net/socket.c:2609 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Allocated by task 4718: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x28/0x34 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa0/0xb8 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:936 [inline] __kmalloc+0xec/0x178 mm/slab_common.c:949 kmalloc include/linux/slab.h:568 [inline] tomoyo_realpath_from_path+0xc4/0x4d4 security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x190/0x4dc security/tomoyo/file.c:723 tomoyo_file_ioctl+0x2c/0x3c security/tomoyo/tomoyo.c:336 security_file_ioctl+0x80/0xbc security/security.c:1568 __do_sys_ioctl fs/ioctl.c:864 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xa8/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Freed by task 4718: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x3c/0x60 mm/kasan/generic.c:516 ____kasan_slab_free+0x148/0x1b0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1729 [inline] slab_free_freelist_hook+0x16c/0x1ec mm/slub.c:1755 slab_free mm/slub.c:3687 [inline] __kmem_cache_free+0xc0/0x224 mm/slub.c:3700 kfree+0xd0/0x1ac mm/slab_common.c:988 tomoyo_realpath_from_path+0x48c/0x4d4 security/tomoyo/realpath.c:286 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_number_perm+0x190/0x4dc security/tomoyo/file.c:723 tomoyo_file_ioctl+0x2c/0x3c security/tomoyo/tomoyo.c:336 security_file_ioctl+0x80/0xbc security/security.c:1568 __do_sys_ioctl fs/ioctl.c:864 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __arm64_sys_ioctl+0xa8/0x1c8 fs/ioctl.c:856 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2bc arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x58/0x13c arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x138 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the object at ffff0000d87a2000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 941 bytes to the right of 4096-byte region [ffff0000d87a2000, ffff0000d87a3000) The buggy address belongs to the physical page: page:00000000ea57bfeb refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1187a0 head:00000000ea57bfeb order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000001 ffff0000c0002a80 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d87a3280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d87a3300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000d87a3380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000d87a3400: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d87a3480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================