================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff8880514995d4 by task syz-executor.3/21257 CPU: 1 PID: 21257 Comm: syz-executor.3 Not tainted 6.5.0-rc6-syzkaller-00138-ga0e026e7b37e #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 __xfrm_decode_session+0x54/0xb0 net/xfrm/xfrm_policy.c:3566 xfrm_decode_session_reverse include/net/xfrm.h:1223 [inline] icmpv6_route_lookup+0x397/0x550 net/ipv6/icmp.c:388 icmp6_send+0x11c1/0x2720 net/ipv6/icmp.c:595 __icmpv6_send include/linux/icmpv6.h:28 [inline] icmpv6_send include/linux/icmpv6.h:49 [inline] ip6_link_failure+0x31/0x5a0 net/ipv6/route.c:2785 dst_link_failure include/net/dst.h:437 [inline] ip6_tnl_xmit+0x4f9/0x3960 net/ipv6/ip6_tunnel.c:1268 ipxip6_tnl_xmit net/ipv6/ip6_tunnel.c:1384 [inline] ip6_tnl_start_xmit+0x6ef/0x1750 net/ipv6/ip6_tunnel.c:1432 __netdev_start_xmit include/linux/netdevice.h:4910 [inline] netdev_start_xmit include/linux/netdevice.h:4924 [inline] xmit_one net/core/dev.c:3537 [inline] dev_hard_start_xmit+0x13d/0x6c0 net/core/dev.c:3553 sch_direct_xmit+0x1ac/0xc20 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x540/0x19d0 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3827 [inline] __dev_queue_xmit+0x26ab/0x3f20 net/core/dev.c:4169 dev_queue_xmit include/linux/netdevice.h:3088 [inline] neigh_connected_output+0x42c/0x5d0 net/core/neighbour.c:1581 neigh_output include/net/neighbour.h:544 [inline] ip6_finish_output2+0x5d0/0x1b20 net/ipv6/ip6_output.c:135 ip6_fragment+0xbf4/0x2a40 net/ipv6/ip6_output.c:1008 __ip6_finish_output net/ipv6/ip6_output.c:194 [inline] ip6_finish_output+0x7a8/0x11d0 net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip6_output+0x243/0x890 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] NF_HOOK include/linux/netfilter.h:297 [inline] ip6_xmit+0xe1d/0x1fe0 net/ipv6/ip6_output.c:344 sctp_v6_xmit+0xc16/0x1110 net/sctp/ipv6.c:250 sctp_packet_transmit+0x22e1/0x3010 net/sctp/output.c:653 sctp_packet_singleton+0x19f/0x370 net/sctp/outqueue.c:783 sctp_outq_flush_ctrl net/sctp/outqueue.c:914 [inline] sctp_outq_flush+0x54c/0x3340 net/sctp/outqueue.c:1212 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1818 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline] sctp_do_sm+0x1786/0x5c40 net/sctp/sm_sideeffect.c:1169 sctp_primitive_ASSOCIATE+0x9c/0xc0 net/sctp/primitive.c:73 sctp_sendmsg_to_asoc+0xa2b/0x1a90 net/sctp/socket.c:1840 sctp_sendmsg+0xee4/0x1e80 net/sctp/socket.c:2030 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:830 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:748 ____sys_sendmsg+0x2ac/0x940 net/socket.c:2494 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2548 __sys_sendmmsg+0x1a1/0x450 net/socket.c:2634 __do_sys_sendmmsg net/socket.c:2663 [inline] __se_sys_sendmmsg net/socket.c:2660 [inline] __x64_sys_sendmmsg+0x9c/0x100 net/socket.c:2660 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7efcfb87cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007efcfc6230c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007efcfb99bf80 RCX: 00007efcfb87cae9 RDX: 0000000000000003 RSI: 0000000020008840 RDI: 0000000000000003 RBP: 00007efcfb8c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000044 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007efcfb99bf80 R15: 00007ffe60d6fed8 Allocated by task 21257: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xa2/0xb0 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:196 [inline] __do_kmalloc_node mm/slab_common.c:985 [inline] __kmalloc_node_track_caller+0x5e/0x100 mm/slab_common.c:1005 kmalloc_reserve+0xef/0x270 net/core/skbuff.c:575 __alloc_skb+0x12b/0x330 net/core/skbuff.c:644 alloc_skb include/linux/skbuff.h:1289 [inline] ip6_frag_next+0x15d/0xb50 net/ipv6/ip6_output.c:786 ip6_fragment+0xb33/0x2a40 net/ipv6/ip6_output.c:998 __ip6_finish_output net/ipv6/ip6_output.c:194 [inline] ip6_finish_output+0x7a8/0x11d0 net/ipv6/ip6_output.c:207 NF_HOOK_COND include/linux/netfilter.h:292 [inline] ip6_output+0x243/0x890 net/ipv6/ip6_output.c:228 dst_output include/net/dst.h:458 [inline] NF_HOOK include/linux/netfilter.h:303 [inline] NF_HOOK include/linux/netfilter.h:297 [inline] ip6_xmit+0xe1d/0x1fe0 net/ipv6/ip6_output.c:344 sctp_v6_xmit+0xc16/0x1110 net/sctp/ipv6.c:250 sctp_packet_transmit+0x22e1/0x3010 net/sctp/output.c:653 sctp_packet_singleton+0x19f/0x370 net/sctp/outqueue.c:783 sctp_outq_flush_ctrl net/sctp/outqueue.c:914 [inline] sctp_outq_flush+0x54c/0x3340 net/sctp/outqueue.c:1212 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1818 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline] sctp_do_sm+0x1786/0x5c40 net/sctp/sm_sideeffect.c:1169 sctp_primitive_ASSOCIATE+0x9c/0xc0 net/sctp/primitive.c:73 sctp_sendmsg_to_asoc+0xa2b/0x1a90 net/sctp/socket.c:1840 sctp_sendmsg+0xee4/0x1e80 net/sctp/socket.c:2030 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:830 sock_sendmsg_nosec net/socket.c:725 [inline] sock_sendmsg+0xd9/0x180 net/socket.c:748 ____sys_sendmsg+0x2ac/0x940 net/socket.c:2494 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2548 __sys_sendmmsg+0x1a1/0x450 net/socket.c:2634 __do_sys_sendmmsg net/socket.c:2663 [inline] __se_sys_sendmmsg net/socket.c:2660 [inline] __x64_sys_sendmmsg+0x9c/0x100 net/socket.c:2660 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 kvfree_call_rcu+0x70/0xbe0 kernel/rcu/tree.c:3368 batadv_hardif_release+0xa4/0xd0 net/batman-adv/hard-interface.c:55 kref_put include/linux/kref.h:65 [inline] batadv_hardif_put net/batman-adv/hard-interface.h:95 [inline] batadv_hardif_put net/batman-adv/hard-interface.h:90 [inline] batadv_hard_if_event+0x114d/0x1660 net/batman-adv/hard-interface.c:1014 notifier_call_chain+0xb6/0x3b0 kernel/notifier.c:93 call_netdevice_notifiers_info+0xb9/0x130 net/core/dev.c:1962 call_netdevice_notifiers_extack net/core/dev.c:2000 [inline] call_netdevice_notifiers net/core/dev.c:2014 [inline] unregister_netdevice_many_notify+0x82b/0x19a0 net/core/dev.c:10850 ip_tunnel_delete_nets+0x2bb/0x3a0 net/ipv4/ip_tunnel.c:1144 ops_exit_list+0x125/0x170 net/core/net_namespace.c:175 setup_net+0x64d/0xa40 net/core/net_namespace.c:362 copy_net_ns+0x2fa/0x670 net/core/net_namespace.c:491 create_new_namespaces+0x3ea/0xb10 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:228 ksys_unshare+0x3da/0x930 kernel/fork.c:3438 __do_sys_unshare kernel/fork.c:3509 [inline] __se_sys_unshare kernel/fork.c:3507 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3507 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Second to last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2649 sctp_transport_destroy net/sctp/transport.c:171 [inline] sctp_transport_put+0x121/0x180 net/sctp/transport.c:484 sctp_association_free+0x4d3/0x7d0 net/sctp/associola.c:379 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1330 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1198 [inline] sctp_do_sm+0x2636/0x5c40 net/sctp/sm_sideeffect.c:1169 sctp_assoc_bh_rcv+0x392/0x6f0 net/sctp/associola.c:1051 sctp_inq_push+0x1d5/0x270 net/sctp/inqueue.c:80 sctp_backlog_rcv+0x169/0x590 net/sctp/input.c:331 sk_backlog_rcv include/net/sock.h:1115 [inline] __release_sock+0x132/0x3a0 net/core/sock.c:2981 release_sock+0x58/0x1b0 net/core/sock.c:3518 sctp_close+0x447/0x940 net/sctp/socket.c:1535 inet_release+0x132/0x270 net/ipv4/af_inet.c:427 inet6_release+0x4f/0x70 net/ipv6/af_inet6.c:480 __sock_release+0xcd/0x290 net/socket.c:654 sock_close+0x1c/0x20 net/socket.c:1386 __fput+0x3f7/0xac0 fs/file_table.c:384 task_work_run+0x14d/0x240 kernel/task_work.c:179 get_signal+0x1075/0x2770 kernel/signal.c:2657 arch_do_signal_or_restart+0x89/0x5f0 arch/x86/kernel/signal.c:308 exit_to_user_mode_loop kernel/entry/common.c:168 [inline] exit_to_user_mode_prepare+0x11f/0x240 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x1d/0x50 kernel/entry/common.c:297 do_syscall_64+0x44/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888051499000 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 468 bytes to the right of allocated 1024-byte region [ffff888051499000, ffff888051499400) The buggy address belongs to the physical page: page:ffffea0001452600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x51498 head:ffffea0001452600 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000010200 ffff888012841dc0 ffffea0000cfe200 dead000000000002 raw: 0000000000000000 0000000080100010 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 0x152820(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL), pid 5112, tgid 5112 (kworker/1:7), ts 88642249150, free_ts 88631064118 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d2/0x350 mm/page_alloc.c:1570 prep_new_page mm/page_alloc.c:1577 [inline] get_page_from_freelist+0x10a9/0x31e0 mm/page_alloc.c:3221 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4477 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2292 alloc_slab_page mm/slub.c:1862 [inline] allocate_slab+0x24e/0x380 mm/slub.c:2009 new_slab mm/slub.c:2062 [inline] ___slab_alloc+0x8bc/0x1570 mm/slub.c:3215 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3314 __slab_alloc_node mm/slub.c:3367 [inline] slab_alloc_node mm/slub.c:3460 [inline] __kmem_cache_alloc_node+0x137/0x350 mm/slub.c:3509 __do_kmalloc_node mm/slab_common.c:984 [inline] __kmalloc+0x4c/0x100 mm/slab_common.c:998 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:703 [inline] ieee802_11_parse_elems_full+0xc7/0x1380 net/mac80211/util.c:1602 ieee802_11_parse_elems_crc net/mac80211/ieee80211_i.h:2327 [inline] ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2334 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1609 [inline] ieee80211_ibss_rx_queued_mgmt+0xc65/0x2ee0 net/mac80211/ibss.c:1642 ieee80211_iface_process_skb net/mac80211/iface.c:1604 [inline] ieee80211_iface_work+0xa1f/0xd40 net/mac80211/iface.c:1658 cfg80211_wiphy_work+0x24e/0x330 net/wireless/core.c:435 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2600 worker_thread+0x687/0x1110 kernel/workqueue.c:2751 kthread+0x33a/0x430 kernel/kthread.c:389 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1161 [inline] free_unref_page_prepare+0x508/0xb90 mm/page_alloc.c:2348 free_unref_page+0x33/0x3b0 mm/page_alloc.c:2443 __folio_put_large mm/swap.c:119 [inline] __folio_put+0x10a/0x140 mm/swap.c:127 folio_put include/linux/mm.h:1440 [inline] put_page include/linux/mm.h:1509 [inline] napi_frag_unref include/linux/skbuff.h:3435 [inline] skb_release_data+0x559/0x870 net/core/skbuff.c:930 skb_release_all net/core/skbuff.c:1002 [inline] __kfree_skb net/core/skbuff.c:1016 [inline] skb_attempt_defer_free+0x3bc/0x570 net/core/skbuff.c:6739 tcp_eat_recv_skb net/ipv4/tcp.c:1504 [inline] tcp_recvmsg_locked+0x123c/0x24b0 net/ipv4/tcp.c:2520 tcp_recvmsg+0x12e/0x670 net/ipv4/tcp.c:2566 inet6_recvmsg+0x114/0x640 net/ipv6/af_inet6.c:670 sock_recvmsg_nosec net/socket.c:1020 [inline] sock_recvmsg+0xe2/0x170 net/socket.c:1041 ____sys_recvmsg+0x21f/0x5c0 net/socket.c:2713 ___sys_recvmsg+0x115/0x1a0 net/socket.c:2755 __sys_recvmsg+0x114/0x1e0 net/socket.c:2785 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888051499480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888051499500: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888051499580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff888051499600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888051499680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================