================================================================== BUG: KASAN: use-after-free in decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 Read of size 1 at addr ffff888028a118af by task syz-executor.0/12072 CPU: 0 PID: 12072 Comm: syz-executor.0 Not tainted 5.10.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562 decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 __xfrm_decode_session net/xfrm/xfrm_policy.c:3485 [inline] __xfrm_policy_check+0x2fa/0x2850 net/xfrm/xfrm_policy.c:3540 __xfrm_policy_check2 include/net/xfrm.h:1097 [inline] xfrm_policy_check include/net/xfrm.h:1106 [inline] sctp_rcv+0x12b0/0x2e30 net/sctp/input.c:202 sctp6_rcv+0x22/0x40 net/sctp/ipv6.c:1078 ip6_protocol_deliver_rcu+0x2e8/0x1680 net/ipv6/ip6_input.c:433 ip6_input_finish+0x7f/0x160 net/ipv6/ip6_input.c:474 NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ip6_input+0x9c/0xd0 net/ipv6/ip6_input.c:483 dst_input include/net/dst.h:447 [inline] ip6_rcv_finish net/ipv6/ip6_input.c:76 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ipv6_rcv+0x28e/0x3c0 net/ipv6/ip6_input.c:307 __netif_receive_skb_one_core+0x114/0x180 net/core/dev.c:5315 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5429 process_backlog+0x232/0x6c0 net/core/dev.c:6319 napi_poll net/core/dev.c:6763 [inline] net_rx_action+0x4dc/0x1100 net/core/dev.c:6833 __do_softirq+0x2a0/0x9f6 kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 do_softirq kernel/softirq.c:343 [inline] do_softirq+0xb5/0xe0 kernel/softirq.c:330 __local_bh_enable_ip+0xf0/0x110 kernel/softirq.c:195 local_bh_enable include/linux/bottom_half.h:32 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:730 [inline] ip6_finish_output2+0x71f/0x16c0 net/ipv6/ip6_output.c:118 __ip6_finish_output net/ipv6/ip6_output.c:143 [inline] __ip6_finish_output+0x447/0xab0 net/ipv6/ip6_output.c:128 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153 NF_HOOK_COND include/linux/netfilter.h:290 [inline] ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176 dst_output include/net/dst.h:441 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] NF_HOOK include/linux/netfilter.h:295 [inline] ip6_xmit+0x1258/0x1e80 net/ipv6/ip6_output.c:280 sctp_v6_xmit+0xbf3/0xfe0 net/sctp/ipv6.c:223 sctp_packet_transmit+0x1f44/0x32f0 net/sctp/output.c:627 sctp_packet_singleton net/sctp/outqueue.c:773 [inline] sctp_outq_flush_ctrl.constprop.0+0x6d3/0xc40 net/sctp/outqueue.c:904 sctp_outq_flush+0xf3/0x2580 net/sctp/outqueue.c:1186 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1314 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline] sctp_do_sm+0x3c97/0x5130 net/sctp/sm_sideeffect.c:1156 sctp_assoc_bh_rcv+0x386/0x6c0 net/sctp/associola.c:1048 sctp_inq_push+0x1da/0x270 net/sctp/inqueue.c:80 sctp_backlog_rcv+0x19e/0x5c0 net/sctp/input.c:344 sk_backlog_rcv include/net/sock.h:1010 [inline] __release_sock+0x134/0x3a0 net/core/sock.c:2523 release_sock+0x54/0x1b0 net/core/sock.c:3053 sctp_wait_for_connect+0x31c/0x570 net/sctp/socket.c:9177 sctp_sendmsg_to_asoc+0x17a2/0x2140 net/sctp/socket.c:1867 sctp_sendmsg+0x103b/0x1d30 net/sctp/socket.c:2013 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:817 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 __sys_sendto+0x21c/0x320 net/socket.c:1992 __do_sys_sendto net/socket.c:2004 [inline] __se_sys_sendto net/socket.c:2000 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2000 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45deb9 Code: 0d b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f22b4cf8c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000002e940 RCX: 000000000045deb9 RDX: 0000000000034000 RSI: 0000000020847fff RDI: 0000000000000003 RBP: 000000000118bf78 R08: 000000002005ffe4 R09: 000000000000001c R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007ffc6c077f7f R14: 00007f22b4cf99c0 R15: 000000000118bf2c Allocated by task 10847: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] snmp6_alloc_dev net/ipv6/addrconf.c:345 [inline] ipv6_add_dev+0x4a0/0x10f0 net/ipv6/addrconf.c:398 addrconf_notify+0x8d7/0x23f0 net/ipv6/addrconf.c:3488 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2035 call_netdevice_notifiers_extack net/core/dev.c:2047 [inline] call_netdevice_notifiers net/core/dev.c:2061 [inline] register_netdevice+0x1068/0x1630 net/core/dev.c:9999 register_netdev+0x2d/0x50 net/core/dev.c:10099 ip6_tnl_init_net+0x54d/0x850 net/ipv6/ip6_tunnel.c:2307 ops_init+0xaf/0x470 net/core/net_namespace.c:152 setup_net+0x2d8/0x850 net/core/net_namespace.c:342 copy_net_ns+0x2cf/0x5e0 net/core/net_namespace.c:483 create_new_namespaces+0x3f6/0xb10 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:231 ksys_unshare+0x445/0x8e0 kernel/fork.c:2949 __do_sys_unshare kernel/fork.c:3017 [inline] __se_sys_unshare kernel/fork.c:3015 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3015 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888028a11880 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 47 bytes inside of 64-byte region [ffff888028a11880, ffff888028a118c0) The buggy address belongs to the page: page:00000000e1577a88 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888028a11a80 pfn:0x28a11 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea00008cb588 ffffea00006ef188 ffff8880100418c0 raw: ffff888028a11a80 0000000000200019 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888028a11780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888028a11800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff888028a11880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888028a11900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888028a11980: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================