================================================================== BUG: KASAN: use-after-free in __xfrm6_tunnel_spi_lookup+0x3a9/0x3b0 net/ipv6/xfrm6_tunnel.c:79 Read of size 8 at addr ffff888088e8d850 by task syz-executor.3/8337 CPU: 1 PID: 8337 Comm: syz-executor.3 Not tainted 5.8.0-rc5-next-20200716-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+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 __xfrm6_tunnel_spi_lookup+0x3a9/0x3b0 net/ipv6/xfrm6_tunnel.c:79 xfrm6_tunnel_spi_lookup+0x8a/0x1d0 net/ipv6/xfrm6_tunnel.c:95 ipcomp6_tunnel_attach net/ipv6/ipcomp6.c:119 [inline] ipcomp6_init_state net/ipv6/ipcomp6.c:159 [inline] ipcomp6_init_state+0x1de/0x700 net/ipv6/ipcomp6.c:139 __xfrm_init_state+0x9a6/0x14b0 net/xfrm/xfrm_state.c:2498 xfrm_init_state+0x1a/0x70 net/xfrm/xfrm_state.c:2525 pfkey_msg2xfrm_state net/key/af_key.c:1291 [inline] pfkey_add+0x1a10/0x2b70 net/key/af_key.c:1508 pfkey_process+0x66d/0x7a0 net/key/af_key.c:2834 pfkey_sendmsg+0x42d/0x800 net/key/af_key.c:3673 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x331/0x810 net/socket.c:2362 ___sys_sendmsg+0xf3/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+0x60/0xe0 arch/x86/entry/common.c:384 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45c1d9 Code: Bad RIP value. RSP: 002b:00007fe925bfbc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000025a40 RCX: 000000000045c1d9 RDX: 0000000000000393 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 000000000078bf48 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000078bf0c R13: 00007fff27f7982f R14: 00007fe925bfc9c0 R15: 000000000078bf0c Allocated by task 23: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 __kmalloc_reserve net/core/skbuff.c:142 [inline] __alloc_skb+0xae/0x550 net/core/skbuff.c:210 __pskb_copy_fclone+0xf8/0xca0 net/core/skbuff.c:1552 __pskb_copy include/linux/skbuff.h:1148 [inline] create_tagged_skb net/hsr/hsr_forward.c:158 [inline] frame_get_tagged_skb net/hsr/hsr_forward.c:194 [inline] hsr_forward_do net/hsr/hsr_forward.c:273 [inline] hsr_forward_skb+0x86d/0x1cdd net/hsr/hsr_forward.c:361 hsr_dev_xmit+0x78/0xd0 net/hsr/hsr_device.c:221 __netdev_start_xmit include/linux/netdevice.h:4621 [inline] netdev_start_xmit include/linux/netdevice.h:4635 [inline] xmit_one net/core/dev.c:3562 [inline] dev_hard_start_xmit+0x193/0x950 net/core/dev.c:3578 __dev_queue_xmit+0x2096/0x2d60 net/core/dev.c:4137 neigh_connected_output+0x299/0x370 net/core/neighbour.c:1518 neigh_output include/net/neighbour.h:509 [inline] ip6_finish_output2+0x8b6/0x17b0 net/ipv6/ip6_output.c:117 __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:296 [inline] ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176 dst_output include/net/dst.h:443 [inline] NF_HOOK include/linux/netfilter.h:307 [inline] ndisc_send_skb+0xa69/0x1720 net/ipv6/ndisc.c:506 ndisc_send_rs+0x12e/0x700 net/ipv6/ndisc.c:700 addrconf_dad_completed+0x31b/0xcd0 net/ipv6/addrconf.c:4166 addrconf_dad_work+0x797/0x1280 net/ipv6/addrconf.c:4076 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Freed by task 23: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kfree+0x103/0x2c0 mm/slab.c:3756 skb_free_head net/core/skbuff.c:590 [inline] skb_release_data+0x6d9/0x910 net/core/skbuff.c:610 skb_release_all net/core/skbuff.c:664 [inline] __kfree_skb net/core/skbuff.c:678 [inline] kfree_skb.part.0+0xc2/0x350 net/core/skbuff.c:696 kfree_skb+0x7d/0x100 include/linux/refcount.h:270 __netif_receive_skb_core+0x56b/0x3690 net/core/dev.c:5261 __netif_receive_skb_one_core+0xae/0x180 net/core/dev.c:5285 __netif_receive_skb+0x27/0x1c0 net/core/dev.c:5401 process_backlog+0x28d/0x7f0 net/core/dev.c:6245 napi_poll net/core/dev.c:6690 [inline] net_rx_action+0x4a1/0xe80 net/core/dev.c:6760 __do_softirq+0x34c/0xa60 kernel/softirq.c:292 The buggy address belongs to the object at ffff888088e8d800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 80 bytes inside of 512-byte region [ffff888088e8d800, ffff888088e8da00) The buggy address belongs to the page: page:0000000051e5d3c8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x88e8d flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002a25388 ffffea0002a253c8 ffff8880aa000600 raw: 0000000000000000 ffff888088e8d000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888088e8d700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888088e8d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888088e8d800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888088e8d880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888088e8d900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================