================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0x10e1/0x1950 net/xfrm/xfrm_policy.c:3460 Read of size 1 at addr ffff88807eb63ff5 by task syz-executor.3/1816 CPU: 1 PID: 1816 Comm: syz-executor.3 Not tainted 6.5.0-rc4-syzkaller-00245-gf6a691685962 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/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_finish_output net/ipv6/ip6_output.c:196 [inline] ip6_finish_output+0x485/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] ip6_local_out+0xaf/0x190 net/ipv6/output_core.c:155 ip6_send_skb+0xb7/0x330 net/ipv6/ip6_output.c:2008 ip6_push_pending_frames+0xe0/0x100 net/ipv6/ip6_output.c:2028 rawv6_push_pending_frames net/ipv6/raw.c:582 [inline] rawv6_sendmsg+0x2fa0/0x40d0 net/ipv6/raw.c:926 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+0x6ac/0x940 net/socket.c:2494 ___sys_sendmsg+0x135/0x1d0 net/socket.c:2548 __sys_sendmsg+0x117/0x1e0 net/socket.c:2577 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x61/0xe0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 RIP: 0023:0xf7f35579 Code: b8 01 10 06 03 74 b4 01 10 07 03 74 b0 01 10 08 03 74 d8 01 00 00 00 00 00 00 00 00 00 00 00 00 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 90 90 90 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 RSP: 002b:00000000f7f305ac EFLAGS: 00000292 ORIG_RAX: 0000000000000172 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000020000080 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 29349: 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+0x5d/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_inform_bss+0x120/0x1150 net/mac80211/scan.c:79 rdev_inform_bss+0xea/0x420 net/wireless/rdev-ops.h:418 cfg80211_inform_single_bss_frame_data+0x82d/0xf30 net/wireless/scan.c:2885 cfg80211_inform_bss_frame_data+0xbf/0x290 net/wireless/scan.c:2912 ieee80211_bss_info_update+0x37b/0x9a0 net/mac80211/scan.c:211 ieee80211_rx_bss_info net/mac80211/ibss.c:1124 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1613 [inline] ieee80211_ibss_rx_queued_mgmt+0x195f/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:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 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_primitive_SHUTDOWN+0x9f/0xc0 net/sctp/primitive.c:89 sctp_close+0x3ed/0x940 net/sctp/socket.c:1527 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+0x3fd/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_fast_syscall_32+0x6d/0xe0 arch/x86/entry/common.c:181 do_fast_syscall_32+0x33/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x70/0x82 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 rxrpc_put_local net/rxrpc/local_object.c:364 [inline] rxrpc_put_local+0x134/0x170 net/rxrpc/local_object.c:350 rxrpc_release_sock net/rxrpc/af_rxrpc.c:907 [inline] rxrpc_release+0x23d/0x560 net/rxrpc/af_rxrpc.c:933 __sock_release net/socket.c:654 [inline] sock_release+0x8b/0x1d0 net/socket.c:682 afs_close_socket+0x1c8/0x340 fs/afs/rxrpc.c:127 afs_net_exit+0x8f/0xf0 fs/afs/main.c:158 ops_exit_list+0xb0/0x170 net/core/net_namespace.c:170 cleanup_net+0x505/0xb20 net/core/net_namespace.c:614 process_one_work+0xaa2/0x16f0 kernel/workqueue.c:2597 worker_thread+0x687/0x1110 kernel/workqueue.c:2748 kthread+0x33a/0x430 kernel/kthread.c:389 ret_from_fork+0x2c/0x70 arch/x86/kernel/process.c:145 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 The buggy address belongs to the object at ffff88807eb63800 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 1013 bytes to the right of allocated 1024-byte region [ffff88807eb63800, ffff88807eb63c00) The buggy address belongs to the physical page: page:ffffea0001fad800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88807eb63000 pfn:0x7eb60 head:ffffea0001fad800 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 ffffea0001412210 ffffea0000907c10 raw: ffff88807eb63000 0000000000100001 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 15293, tgid 15282 (syz-executor.0), ts 2385029224071, free_ts 2384997036086 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 kmalloc_trace+0x25/0xe0 mm/slab_common.c:1076 kmalloc include/linux/slab.h:582 [inline] kzalloc include/linux/slab.h:703 [inline] batadv_hardif_add_interface net/batman-adv/hard-interface.c:864 [inline] batadv_hard_if_event+0xb5f/0x1600 net/batman-adv/hard-interface.c:952 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] register_netdevice+0x1029/0x1630 net/core/dev.c:10084 __ip_tunnel_create+0x4a1/0x670 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x237/0x5e0 net/ipv4/ip_tunnel.c:1091 ops_init+0xb9/0x650 net/core/net_namespace.c:136 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 __unfreeze_partials+0x21d/0x240 mm/slub.c:2647 qlink_free mm/kasan/quarantine.c:166 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:185 kasan_quarantine_reduce+0x18b/0x1d0 mm/kasan/quarantine.c:292 __kasan_slab_alloc+0x65/0x90 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slub.c:3470 [inline] __kmem_cache_alloc_node+0x19b/0x350 mm/slub.c:3509 kmalloc_node_trace+0x22/0xd0 mm/slab_common.c:1089 kmalloc_node include/linux/slab.h:598 [inline] kzalloc_node include/linux/slab.h:714 [inline] __get_vm_area_node+0xe1/0x3d0 mm/vmalloc.c:2588 __vmalloc_node_range+0x27a/0x1540 mm/vmalloc.c:3276 __vmalloc_node mm/vmalloc.c:3381 [inline] vmalloc+0x6b/0x80 mm/vmalloc.c:3414 xt_compat_init_offsets+0xe3/0x220 net/netfilter/x_tables.c:733 compat_table_info+0xb7/0x5e0 net/ipv6/netfilter/ip6_tables.c:950 compat_get_entries+0x212/0x850 net/ipv6/netfilter/ip6_tables.c:1603 do_ip6t_get_ctl+0x569/0xab0 net/ipv6/netfilter/ip6_tables.c:1666 nf_getsockopt+0x76/0xe0 net/netfilter/nf_sockopt.c:116 Memory state around the buggy address: ffff88807eb63e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88807eb63f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88807eb63f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88807eb64000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807eb64080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 10 06 adc %al,(%rsi) 2: 03 74 b4 01 add 0x1(%rsp,%rsi,4),%esi 6: 10 07 adc %al,(%rdi) 8: 03 74 b0 01 add 0x1(%rax,%rsi,4),%esi c: 10 08 adc %cl,(%rax) e: 03 74 d8 01 add 0x1(%rax,%rbx,8),%esi 1e: 00 51 52 add %dl,0x52(%rcx) 21: 55 push %rbp 22: 89 e5 mov %esp,%ebp 24: 0f 34 sysenter 26: cd 80 int $0x80 * 28: 5d pop %rbp <-- trapping instruction 29: 5a pop %rdx 2a: 59 pop %rcx 2b: c3 ret 2c: 90 nop 2d: 90 nop 2e: 90 nop 2f: 90 nop 30: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi 37: 8d b4 26 00 00 00 00 lea 0x0(%rsi,%riz,1),%esi