================================================================== BUG: KASAN: slab-out-of-bounds in decode_session6+0xfd7/0x1820 net/xfrm/xfrm_policy.c:3371 Read of size 1 at addr ffff88805f2c7620 by task kworker/u4:0/8 CPU: 1 PID: 8 Comm: kworker/u4:0 Not tainted 5.17.0-rc5-syzkaller-00189-g53ab78cd6d5a #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: phy7 ieee80211_iface_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0x8d/0x336 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 decode_session6+0xfd7/0x1820 net/xfrm/xfrm_policy.c:3371 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3477 xfrm_decode_session include/net/xfrm.h:1155 [inline] vti6_tnl_xmit+0x41f/0x1fe0 net/ipv6/ip6_vti.c:577 __netdev_start_xmit include/linux/netdevice.h:4683 [inline] netdev_start_xmit include/linux/netdevice.h:4697 [inline] xmit_one net/core/dev.c:3473 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3489 sch_direct_xmit+0x19f/0xbe0 net/sched/sch_generic.c:342 qdisc_restart net/sched/sch_generic.c:407 [inline] __qdisc_run+0x4c0/0x1720 net/sched/sch_generic.c:415 __dev_xmit_skb net/core/dev.c:3762 [inline] __dev_queue_xmit+0x2084/0x3660 net/core/dev.c:4081 neigh_connected_output+0x3b6/0x510 net/core/neighbour.c:1557 neigh_output include/net/neighbour.h:549 [inline] ip6_finish_output2+0x56e/0x14f0 net/ipv6/ip6_output.c:126 __ip6_finish_output net/ipv6/ip6_output.c:191 [inline] __ip6_finish_output+0x61e/0xe90 net/ipv6/ip6_output.c:170 ip6_finish_output+0x32/0x200 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x1e4/0x530 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:451 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xa99/0x17f0 net/ipv6/ndisc.c:508 ndisc_send_rs+0x12e/0x6f0 net/ipv6/ndisc.c:702 addrconf_rs_timer+0x3f2/0x820 net/ipv6/addrconf.c:3911 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x67c/0xa30 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1747 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:kasan_quarantine_put+0x9b/0x210 mm/kasan/quarantine.c:234 Code: 10 48 81 fb 00 00 10 00 48 89 58 10 77 78 4d 85 ed 75 6c 9c 58 f6 c4 02 0f 85 23 01 00 00 4d 85 ed b8 01 00 00 00 74 01 fb 5b <5d> 41 5c 41 5d 41 5e c3 e8 18 a0 be ff 48 c7 c3 00 5e 03 00 e8 6c RSP: 0018:ffffc90000cd78a8 EFLAGS: 00000206 RAX: 0000000000000001 RBX: ffffc90000cd7918 RCX: 1ffffffff1ffd59e RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff8881435edb80 R08: 0000000000000001 R09: ffffffff8ffc39a7 R10: 0000000000000001 R11: 0000000000088078 R12: ffff888010c41640 R13: 0000000000000200 R14: ffffc90000cd7920 R15: ffff8881435edb80 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kfree+0xd0/0x390 mm/slub.c:4562 ieee802_11_parse_elems_crc+0xb15/0x1050 net/mac80211/util.c:1535 ieee802_11_parse_elems net/mac80211/ieee80211_i.h:2228 [inline] ieee80211_rx_mgmt_probe_beacon net/mac80211/ibss.c:1605 [inline] ieee80211_ibss_rx_queued_mgmt+0xd0e/0x3150 net/mac80211/ibss.c:1639 ieee80211_iface_process_skb net/mac80211/iface.c:1527 [inline] ieee80211_iface_work+0xa69/0xd00 net/mac80211/iface.c:1581 process_one_work+0x9ac/0x1650 kernel/workqueue.c:2307 worker_thread+0x657/0x1110 kernel/workqueue.c:2454 kthread+0x2e9/0x3a0 kernel/kthread.c:377 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 3611: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:586 [inline] kzalloc include/linux/slab.h:714 [inline] ops_init+0xfb/0x470 net/core/net_namespace.c:130 setup_net+0x554/0xbb0 net/core/net_namespace.c:330 copy_net_ns+0x318/0x760 net/core/net_namespace.c:474 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3058 __do_sys_unshare kernel/fork.c:3129 [inline] __se_sys_unshare kernel/fork.c:3127 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3127 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88805f2c7400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 32 bytes to the right of 512-byte region [ffff88805f2c7400, ffff88805f2c7600) The buggy address belongs to the page: page:ffffea00017cb100 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805f2c4400 pfn:0x5f2c4 head:ffffea00017cb100 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea00017b3108 ffffea0001971e08 ffff888010c41c80 raw: ffff88805f2c4400 0000000000100006 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3609, ts 40894477917, free_ts 9815848311 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4165 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5389 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x27f/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0xbe1/0x12b0 mm/slub.c:3018 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3105 slab_alloc_node mm/slub.c:3196 [inline] __kmalloc_node_track_caller+0x339/0x470 mm/slub.c:4957 kmalloc_reserve net/core/skbuff.c:354 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 alloc_skb include/linux/skbuff.h:1158 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1189 [inline] netlink_sendmsg+0x98f/0xe00 net/netlink/af_netlink.c:1894 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:725 __sys_sendto+0x21c/0x320 net/socket.c:2040 __do_sys_sendto net/socket.c:2052 [inline] __se_sys_sendto net/socket.c:2048 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2048 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3404 free_contig_range+0xa8/0xf0 mm/page_alloc.c:9335 destroy_args+0xa8/0x646 mm/debug_vm_pgtable.c:1018 debug_vm_pgtable+0x298e/0x2a20 mm/debug_vm_pgtable.c:1332 do_one_initcall+0x103/0x650 init/main.c:1300 do_initcall_level init/main.c:1373 [inline] do_initcalls init/main.c:1389 [inline] do_basic_setup init/main.c:1408 [inline] kernel_init_freeable+0x6b1/0x73a init/main.c:1613 kernel_init+0x1a/0x1d0 init/main.c:1502 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88805f2c7500: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ffff88805f2c7580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88805f2c7600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88805f2c7680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805f2c7700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: 10 48 81 adc %cl,-0x7f(%rax) 3: fb sti 4: 00 00 add %al,(%rax) 6: 10 00 adc %al,(%rax) 8: 48 89 58 10 mov %rbx,0x10(%rax) c: 77 78 ja 0x86 e: 4d 85 ed test %r13,%r13 11: 75 6c jne 0x7f 13: 9c pushfq 14: 58 pop %rax 15: f6 c4 02 test $0x2,%ah 18: 0f 85 23 01 00 00 jne 0x141 1e: 4d 85 ed test %r13,%r13 21: b8 01 00 00 00 mov $0x1,%eax 26: 74 01 je 0x29 28: fb sti 29: 5b pop %rbx * 2a: 5d pop %rbp <-- trapping instruction 2b: 41 5c pop %r12 2d: 41 5d pop %r13 2f: 41 5e pop %r14 31: c3 retq 32: e8 18 a0 be ff callq 0xffbea04f 37: 48 c7 c3 00 5e 03 00 mov $0x35e00,%rbx 3e: e8 .byte 0xe8 3f: 6c insb (%dx),%es:(%rdi)