================================================================== BUG: KASAN: use-after-free in decode_session6 net/xfrm/xfrm_policy.c:3394 [inline] BUG: KASAN: use-after-free in __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3486 Read of size 1 at addr ffff888040104dec by task syz-executor.4/11600 CPU: 0 PID: 11600 Comm: syz-executor.4 Not tainted 5.6.0-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+0x188/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd3/0x315 mm/kasan/report.c:374 __kasan_report.cold+0x1a/0x32 mm/kasan/report.c:506 kasan_report+0xe/0x20 mm/kasan/common.c:641 decode_session6 net/xfrm/xfrm_policy.c:3394 [inline] __xfrm_decode_session+0x1cfb/0x2e90 net/xfrm/xfrm_policy.c:3486 xfrm_decode_session_reverse include/net/xfrm.h:1145 [inline] icmpv6_route_lookup+0x2ce/0x440 net/ipv6/icmp.c:369 icmp6_send+0x12b5/0x2010 net/ipv6/icmp.c:569 icmpv6_send+0xde/0x210 net/ipv6/ip6_icmp.c:43 ip6_link_failure+0x26/0x520 net/ipv6/route.c:2640 dst_link_failure include/net/dst.h:418 [inline] ip6_tnl_xmit+0x460/0x3470 net/ipv6/ip6_tunnel.c:1248 ip6ip6_tnl_xmit net/ipv6/ip6_tunnel.c:1402 [inline] ip6_tnl_start_xmit+0x89a/0x1dc0 net/ipv6/ip6_tunnel.c:1428 __netdev_start_xmit include/linux/netdevice.h:4533 [inline] netdev_start_xmit include/linux/netdevice.h:4547 [inline] xmit_one net/core/dev.c:3477 [inline] dev_hard_start_xmit+0x1a4/0x9b0 net/core/dev.c:3493 sch_direct_xmit+0x345/0xc20 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4d1/0x17b0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3716 [inline] __dev_queue_xmit+0x165b/0x30a0 net/core/dev.c:4021 neigh_output include/net/neighbour.h:510 [inline] ip6_finish_output2+0x1091/0x25b0 net/ipv6/ip6_output.c:117 ip6_fragment+0x1479/0x2540 net/ipv6/ip6_output.c:920 __ip6_finish_output+0x573/0xab0 net/ipv6/ip6_output.c:141 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip6_output+0x239/0x810 net/ipv6/ip6_output.c:176 dst_output include/net/dst.h:435 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip6_xmit+0xe1a/0x2090 net/ipv6/ip6_output.c:280 sctp_v6_xmit+0x33b/0x690 net/sctp/ipv6.c:217 sctp_packet_transmit+0x19fc/0x3490 net/sctp/output.c:629 sctp_packet_singleton net/sctp/outqueue.c:773 [inline] sctp_outq_flush_ctrl.constprop.0+0x6ca/0xc40 net/sctp/outqueue.c:904 sctp_outq_flush+0xf8/0x2340 net/sctp/outqueue.c:1186 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1793 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1185 [inline] sctp_do_sm+0x4db/0x4eb0 net/sctp/sm_sideeffect.c:1156 sctp_primitive_ASSOCIATE+0x98/0xc0 net/sctp/primitive.c:73 __sctp_connect+0x7e8/0xc70 net/sctp/socket.c:1227 __sctp_setsockopt_connectx+0x12d/0x180 net/sctp/socket.c:1336 sctp_setsockopt_connectx net/sctp/socket.c:1368 [inline] sctp_setsockopt net/sctp/socket.c:4713 [inline] sctp_setsockopt+0x15a1/0x7090 net/sctp/socket.c:4670 __sys_setsockopt+0x248/0x480 net/socket.c:2132 __do_sys_setsockopt net/socket.c:2148 [inline] __se_sys_setsockopt net/socket.c:2145 [inline] __x64_sys_setsockopt+0xba/0x150 net/socket.c:2145 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 RIP: 0033:0x45c849 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f58b80ebc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000036 RAX: ffffffffffffffda RBX: 00007f58b80ec6d4 RCX: 000000000045c849 RDX: 000000000000006e RSI: 0000000000000084 RDI: 0000000000000008 RBP: 000000000076bfa0 R08: 000000000000001c R09: 0000000000000000 R10: 0000000020000180 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000ade R14: 00000000004d7138 R15: 000000000076bfac Allocated by task 11591: save_stack+0x1b/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc mm/kasan/common.c:515 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:488 __kmalloc_reserve.isra.0+0x39/0xe0 net/core/skbuff.c:142 __alloc_skb+0xef/0x5a0 net/core/skbuff.c:210 alloc_skb include/linux/skbuff.h:1083 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1175 [inline] netlink_sendmsg+0x97b/0xe10 net/netlink/af_netlink.c:1893 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x308/0x7e0 net/socket.c:2362 ___sys_sendmsg+0x100/0x170 net/socket.c:2416 __sys_sendmmsg+0x195/0x480 net/socket.c:2506 __do_sys_sendmmsg net/socket.c:2535 [inline] __se_sys_sendmmsg net/socket.c:2532 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2532 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 Freed by task 11591: save_stack+0x1b/0x80 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:337 [inline] __kasan_slab_free+0xf7/0x140 mm/kasan/common.c:476 __cache_free mm/slab.c:3426 [inline] kfree+0x109/0x2b0 mm/slab.c:3757 skb_free_head+0x8b/0xa0 net/core/skbuff.c:590 skb_release_data+0x42e/0x8b0 net/core/skbuff.c:610 skb_release_all+0x46/0x60 net/core/skbuff.c:664 __kfree_skb net/core/skbuff.c:678 [inline] consume_skb net/core/skbuff.c:837 [inline] consume_skb+0xf3/0x400 net/core/skbuff.c:831 netlink_unicast_kernel net/netlink/af_netlink.c:1304 [inline] netlink_unicast+0x53f/0x740 net/netlink/af_netlink.c:1329 netlink_sendmsg+0x882/0xe10 net/netlink/af_netlink.c:1918 sock_sendmsg_nosec net/socket.c:652 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:672 ____sys_sendmsg+0x308/0x7e0 net/socket.c:2362 ___sys_sendmsg+0x100/0x170 net/socket.c:2416 __sys_sendmmsg+0x195/0x480 net/socket.c:2506 __do_sys_sendmmsg net/socket.c:2535 [inline] __se_sys_sendmmsg net/socket.c:2532 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2532 do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295 entry_SYSCALL_64_after_hwframe+0x49/0xb3 The buggy address belongs to the object at ffff888040104c00 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 492 bytes inside of 512-byte region [ffff888040104c00, ffff888040104e00) The buggy address belongs to the page: page:ffffea0001004100 refcount:1 mapcount:0 mapping:ffff8880aa000a80 index:0x0 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0000d8f748 ffffea0002419a48 ffff8880aa000a80 raw: 0000000000000000 ffff888040104000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888040104c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888040104d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888040104d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888040104e00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888040104e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================