RBP: 0000000020000080 R08: 00000000000000fc R09: 0000000000000000 R10: 000000000000002e R11: 0000000000000293 R12: 0000000000000013 R13: 0000000000000653 R14: 00000000006fc868 R15: 0000000000000003 protocol 0000 is buggy, dev sit0 ================================================================== BUG: KASAN: use-after-free in copyout+0x7d/0xb0 lib/iov_iter.c:136 Read of size 1 at addr ffff8801ca1ba5c0 by task syz-executor0/12448 CPU: 1 PID: 12448 Comm: syz-executor0 Not tainted 4.16.0+ #14 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x1a7/0x27d lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23c/0x360 mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x137/0x190 mm/kasan/kasan.c:267 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272 copyout+0x7d/0xb0 lib/iov_iter.c:136 _copy_to_iter+0x262/0x13a0 lib/iov_iter.c:565 copy_to_iter include/linux/uio.h:106 [inline] skb_copy_datagram_iter+0x1c2/0xac0 net/core/datagram.c:431 skb_copy_datagram_msg include/linux/skbuff.h:3260 [inline] packet_recvmsg+0x2b9/0x17a0 net/packet/af_packet.c:3341 sock_recvmsg_nosec net/socket.c:802 [inline] sock_recvmsg+0xc9/0x110 net/socket.c:809 sock_read_iter+0x35b/0x560 net/socket.c:886 call_read_iter include/linux/fs.h:1776 [inline] new_sync_read fs/read_write.c:406 [inline] __vfs_read+0x6a7/0xa00 fs/read_write.c:418 vfs_read+0x11e/0x350 fs/read_write.c:452 ksys_read+0xef/0x220 fs/read_write.c:578 SYSC_read fs/read_write.c:588 [inline] SyS_read+0x24/0x30 fs/read_write.c:586 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x4552d9 RSP: 002b:00007fca13285c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000000 RAX: ffffffffffffffda RBX: 00007fca132866d4 RCX: 00000000004552d9 RDX: 0000000000000057 RSI: 00000000200000c0 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 0000000000000486 R14: 00000000006f9d30 R15: 0000000000000000 Allocated by task 12489: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 __do_kmalloc_node mm/slab.c:3670 [inline] __kmalloc_node_track_caller+0x47/0x70 mm/slab.c:3684 __kmalloc_reserve.isra.39+0x41/0xd0 net/core/skbuff.c:137 __alloc_skb+0x12a/0x760 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:987 [inline] alloc_skb_with_frags+0x10d/0x750 net/core/skbuff.c:5248 sock_alloc_send_pskb+0x7b3/0x9e0 net/core/sock.c:2088 packet_alloc_skb net/packet/af_packet.c:2803 [inline] packet_snd net/packet/af_packet.c:2894 [inline] packet_sendmsg+0x1ed7/0x6020 net/packet/af_packet.c:2969 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xca/0x110 net/socket.c:639 __sys_sendto+0x365/0x5a0 net/socket.c:1789 SYSC_sendto net/socket.c:1801 [inline] SyS_sendto+0x40/0x60 net/socket.c:1797 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 12489: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3486 [inline] kfree+0xd9/0x260 mm/slab.c:3801 skb_free_head+0x74/0xb0 net/core/skbuff.c:550 skb_release_data+0x5c1/0x790 net/core/skbuff.c:570 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] kfree_skb+0x16b/0x4c0 net/core/skbuff.c:659 sit_tunnel_xmit+0x157/0x2db0 net/ipv6/sit.c:1042 __netdev_start_xmit include/linux/netdevice.h:4087 [inline] netdev_start_xmit include/linux/netdevice.h:4096 [inline] xmit_one net/core/dev.c:3053 [inline] dev_hard_start_xmit+0x24e/0xac0 net/core/dev.c:3069 __dev_queue_xmit+0x26cf/0x2fd0 net/core/dev.c:3584 dev_queue_xmit+0x17/0x20 net/core/dev.c:3617 packet_snd net/packet/af_packet.c:2944 [inline] packet_sendmsg+0x3ad9/0x6020 net/packet/af_packet.c:2969 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xca/0x110 net/socket.c:639 __sys_sendto+0x365/0x5a0 net/socket.c:1789 SYSC_sendto net/socket.c:1801 [inline] SyS_sendto+0x40/0x60 net/socket.c:1797 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8801ca1ba540 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 128 bytes inside of 512-byte region [ffff8801ca1ba540, ffff8801ca1ba740) The buggy address belongs to the page: page:ffffea0007286e80 count:1 mapcount:0 mapping:ffff8801ca1ba040 index:0xffff8801ca1ba2c0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801ca1ba040 ffff8801ca1ba2c0 0000000100000004 raw: ffffea0006f81aa0 ffffea0006c650a0 ffff8801dac00940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ca1ba480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801ca1ba500: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8801ca1ba580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ca1ba600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ca1ba680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================