================================================================== BUG: KASAN: use-after-free in __xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2019 [inline] BUG: KASAN: use-after-free in xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2053 [inline] BUG: KASAN: use-after-free in xfrm_policy_lookup_bytype+0xd27/0xdb0 net/xfrm/xfrm_policy.c:2113 Read of size 4 at addr ffff888061266574 by task syz-executor1/2187 CPU: 0 PID: 2187 Comm: syz-executor1 Not tainted 4.20.0+ #2 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+0x1db/0x2d0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 __xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2019 [inline] xfrm_policy_eval_candidates net/xfrm/xfrm_policy.c:2053 [inline] xfrm_policy_lookup_bytype+0xd27/0xdb0 net/xfrm/xfrm_policy.c:2113 xfrm_policy_lookup+0x7e/0x90 net/xfrm/xfrm_policy.c:2145 __xfrm_policy_check+0x1426/0x2b00 net/xfrm/xfrm_policy.c:3354 TCP: request_sock_TCP: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. __xfrm_policy_check2 include/net/xfrm.h:1166 [inline] xfrm_policy_check include/net/xfrm.h:1175 [inline] xfrm6_policy_check include/net/xfrm.h:1185 [inline] udpv6_queue_rcv_one_skb+0x532/0x1750 net/ipv6/udp.c:615 udpv6_queue_rcv_skb+0x128/0x730 net/ipv6/udp.c:699 __udp6_lib_mcast_deliver net/ipv6/udp.c:812 [inline] __udp6_lib_rcv+0x1e8d/0x30d0 net/ipv6/udp.c:916 udplitev6_rcv+0x22/0x30 net/ipv6/udplite.c:20 ip6_protocol_deliver_rcu+0x3aa/0x1940 net/ipv6/ip6_input.c:394 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:434 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ip6_input+0xf9/0x600 net/ipv6/ip6_input.c:443 ip6_mc_input+0x4f9/0x10d0 net/ipv6/ip6_input.c:537 dst_input include/net/dst.h:450 [inline] ip6_rcv_finish+0x177/0x330 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ipv6_rcv+0x113/0x650 net/ipv6/ip6_input.c:272 __netif_receive_skb_one_core+0x160/0x210 net/core/dev.c:4973 __netif_receive_skb+0x2c/0x1c0 net/core/dev.c:5083 netif_receive_skb_internal+0x11e/0x690 net/core/dev.c:5186 napi_frags_finish net/core/dev.c:5753 [inline] napi_gro_frags+0xd07/0xfe0 net/core/dev.c:5827 tun_get_user+0x2ec2/0x4150 drivers/net/tun.c:1972 tun_chr_write_iter+0xbd/0x160 drivers/net/tun.c:2017 call_write_iter include/linux/fs.h:1857 [inline] do_iter_readv_writev+0x856/0xae0 fs/read_write.c:680 do_iter_write fs/read_write.c:959 [inline] do_iter_write+0x184/0x600 fs/read_write.c:940 vfs_writev+0x1ee/0x370 fs/read_write.c:1004 do_writev+0x11a/0x300 fs/read_write.c:1039 __do_sys_writev fs/read_write.c:1112 [inline] __se_sys_writev fs/read_write.c:1109 [inline] __x64_sys_writev+0x75/0xb0 fs/read_write.c:1109 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457d81 Code: 75 14 b8 14 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 a4 b8 fb ff c3 48 83 ec 08 e8 1a 2d 00 00 48 89 04 24 b8 14 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 63 2d 00 00 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007f795f675ba0 EFLAGS: 00000293 ORIG_RAX: 0000000000000014 RAX: ffffffffffffffda RBX: 0000000000000083 RCX: 0000000000457d81 RDX: 0000000000000001 RSI: 00007f795f675bf0 RDI: 00000000000000f0 RBP: 0000000020000400 R08: 00000000000000f0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000293 R12: 00007f795f6766d4 R13: 00000000004c61fe R14: 00000000004db0b0 R15: 00000000ffffffff Allocated by task 1382: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xce/0xf0 mm/kasan/kasan.c:531 __do_kmalloc_node mm/slab.c:3684 [inline] __kmalloc_node_track_caller+0x51/0x80 mm/slab.c:3698 __kmalloc_reserve.isra.0+0x40/0xe0 net/core/skbuff.c:140 __alloc_skb+0x12d/0x730 net/core/skbuff.c:208 alloc_skb include/linux/skbuff.h:1011 [inline] alloc_skb_with_frags+0x13a/0x770 net/core/skbuff.c:5288 sock_alloc_send_pskb+0x8c9/0xad0 net/core/sock.c:2091 sock_alloc_send_skb+0x32/0x40 net/core/sock.c:2108 __ip6_append_data.isra.0+0x2556/0x3f20 net/ipv6/ip6_output.c:1443 ip6_make_skb+0x391/0x5f0 net/ipv6/ip6_output.c:1806 udpv6_sendmsg+0x2b58/0x3550 net/ipv6/udp.c:1460 inet_sendmsg+0x1af/0x740 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 ___sys_sendmsg+0x409/0x910 net/socket.c:2116 __sys_sendmmsg+0x246/0x6f0 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg net/socket.c:2237 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2237 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 1382: save_stack+0x45/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 skb_free_head+0x93/0xb0 net/core/skbuff.c:553 skb_release_data+0x6ea/0x970 net/core/skbuff.c:573 skb_release_all+0x4d/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] kfree_skb net/core/skbuff.c:659 [inline] kfree_skb+0x199/0x580 net/core/skbuff.c:653 vti_xmit net/ipv4/ip_vti.c:232 [inline] vti_tunnel_xmit+0x891/0x1730 net/ipv4/ip_vti.c:264 __netdev_start_xmit include/linux/netdevice.h:4382 [inline] netdev_start_xmit include/linux/netdevice.h:4391 [inline] xmit_one net/core/dev.c:3278 [inline] dev_hard_start_xmit+0x261/0xc70 net/core/dev.c:3294 __dev_queue_xmit+0x2f8a/0x3a60 net/core/dev.c:3864 dev_queue_xmit+0x18/0x20 net/core/dev.c:3897 neigh_direct_output+0x16/0x20 net/core/neighbour.c:1511 neigh_output include/net/neighbour.h:508 [inline] ip6_finish_output2+0xc56/0x28e0 net/ipv6/ip6_output.c:120 ip6_finish_output+0x577/0xc30 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip6_output+0x23c/0xa00 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:444 [inline] ip6_local_out+0xc4/0x1b0 net/ipv6/output_core.c:176 ip6_send_skb+0xbb/0x350 net/ipv6/ip6_output.c:1727 udp_v6_send_skb.isra.0+0x834/0x14b0 net/ipv6/udp.c:1169 udpv6_sendmsg+0x2baa/0x3550 net/ipv6/udp.c:1466 inet_sendmsg+0x1af/0x740 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:631 ___sys_sendmsg+0x409/0x910 net/socket.c:2116 __sys_sendmmsg+0x246/0x6f0 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg net/socket.c:2237 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2237 do_syscall_64+0x1a3/0x800 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880612664c0 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 180 bytes inside of 1024-byte region [ffff8880612664c0, ffff8880612668c0) The buggy address belongs to the page: page:ffffea0001849980 count:1 mapcount:0 mapping:ffff88812c3f0ac0 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea0001964808 ffffea0002153f88 ffff88812c3f0ac0 raw: 0000000000000000 ffff888061266040 0000000100000007 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888061266400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888061266480: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff888061266500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888061266580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888061266600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================