------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in net/ipv6/route.c:1095:9 index 40 is out of range for type 'const int[12]' CPU: 1 UID: 0 PID: 5876 Comm: kworker/1:4 Not tainted 6.15.0-rc3-syzkaller-00644-gdeeed351e982 #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/19/2025 Workqueue: wg-crypt-wg0 wg_packet_tx_worker Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 ubsan_epilogue+0xa/0x40 lib/ubsan.c:231 __ubsan_handle_out_of_bounds+0xe9/0xf0 lib/ubsan.c:453 ip6_rt_type_to_error net/ipv6/route.c:1095 [inline] ip6_rt_init_dst_reject net/ipv6/route.c:1112 [inline] ip6_rt_init_dst net/ipv6/route.c:1137 [inline] ip6_rt_copy_init+0x8e7/0x970 net/ipv6/route.c:1175 ip6_rt_pcpu_alloc net/ipv6/route.c:1424 [inline] rt6_make_pcpu_route net/ipv6/route.c:1467 [inline] ip6_pol_route+0xbac/0x1180 net/ipv6/route.c:2302 pol_lookup_func include/net/ip6_fib.h:617 [inline] fib6_rule_lookup+0x348/0x6f0 net/ipv6/fib6_rules.c:125 ip6_route_output_flags_noref net/ipv6/route.c:2681 [inline] ip6_route_output_flags+0x364/0x5d0 net/ipv6/route.c:2693 ip6_dst_lookup_tail+0x299/0x1510 net/ipv6/ip6_output.c:1156 ip6_dst_lookup_flow+0x47/0xe0 net/ipv6/ip6_output.c:1259 send6+0x4cb/0x8d0 drivers/net/wireguard/socket.c:139 wg_socket_send_skb_to_peer+0x111/0x1d0 drivers/net/wireguard/socket.c:178 wg_packet_create_data_done drivers/net/wireguard/send.c:251 [inline] wg_packet_tx_worker+0x1c8/0x7c0 drivers/net/wireguard/send.c:276 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xadb/0x17a0 kernel/workqueue.c:3319 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3400 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:153 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 ---[ end trace ]---