QAT: Invalid ioctl QAT: Invalid ioctl protocol 0800 is buggy, dev ip6tnl0 ================================================================== BUG: KASAN: use-after-free in copyout+0xd7/0x100 lib/iov_iter.c:136 Read of size 10 at addr ffff8801c80d4090 by task syz-executor0/11039 CPU: 1 PID: 11039 Comm: syz-executor0 Not tainted 4.17.0-rc4+ #40 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+0x1b9/0x294 lib/dump_stack.c:113 print_address_description+0x6c/0x20b mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412 check_memory_region_inline mm/kasan/kasan.c:260 [inline] check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267 kasan_check_read+0x11/0x20 mm/kasan/kasan.c:272 copyout+0xd7/0x100 lib/iov_iter.c:136 _copy_to_iter+0x2a5/0x1520 lib/iov_iter.c:565 copy_to_iter include/linux/uio.h:106 [inline] skb_copy_datagram_iter+0x1ce/0xbe0 net/core/datagram.c:431 skb_copy_datagram_msg include/linux/skbuff.h:3260 [inline] packet_recvmsg+0x2e5/0x1770 net/packet/af_packet.c:3350 sock_recvmsg_nosec net/socket.c:802 [inline] sock_recvmsg+0xd0/0x110 net/socket.c:809 sock_read_iter+0x381/0x550 net/socket.c:886 call_read_iter include/linux/fs.h:1778 [inline] do_iter_readv_writev+0x764/0xa50 fs/read_write.c:678 do_iter_read+0x273/0x660 fs/read_write.c:922 vfs_readv+0x14f/0x1a0 fs/read_write.c:986 do_readv+0x112/0x2f0 fs/read_write.c:1019 __do_sys_readv fs/read_write.c:1106 [inline] __se_sys_readv fs/read_write.c:1103 [inline] __x64_sys_readv+0x75/0xb0 fs/read_write.c:1103 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x455979 RSP: 002b:00007f913b7c4c68 EFLAGS: 00000246 ORIG_RAX: 0000000000000013 RAX: ffffffffffffffda RBX: 00007f913b7c56d4 RCX: 0000000000455979 RDX: 0000000000000001 RSI: 0000000020000100 RDI: 0000000000000013 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000004da R14: 00000000006fb510 R15: 0000000000000000 Allocated by task 11098: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node_track_caller+0x47/0x70 mm/slab.c:3696 __kmalloc_reserve.isra.38+0x3a/0xe0 net/core/skbuff.c:137 __alloc_skb+0x14d/0x780 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:987 [inline] alloc_skb_with_frags+0x137/0x760 net/core/skbuff.c:5249 sock_alloc_send_pskb+0x87a/0xae0 net/core/sock.c:2088 packet_alloc_skb net/packet/af_packet.c:2810 [inline] packet_snd net/packet/af_packet.c:2901 [inline] packet_sendmsg+0x1b98/0x6070 net/packet/af_packet.c:2976 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 __sys_sendto+0x3d7/0x670 net/socket.c:1789 __do_sys_sendto net/socket.c:1801 [inline] __se_sys_sendto net/socket.c:1797 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1797 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11098: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xd9/0x260 mm/slab.c:3813 skb_free_head+0x99/0xc0 net/core/skbuff.c:550 skb_release_data+0x690/0x860 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+0x195/0x560 net/core/skbuff.c:659 ip6_tnl_start_xmit+0xa44/0x2290 net/ipv6/ip6_tunnel.c:1411 __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+0x264/0xc10 net/core/dev.c:3069 __dev_queue_xmit+0x2724/0x34c0 net/core/dev.c:3584 dev_queue_xmit+0x17/0x20 net/core/dev.c:3617 packet_snd net/packet/af_packet.c:2951 [inline] packet_sendmsg+0x40f8/0x6070 net/packet/af_packet.c:2976 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:639 __sys_sendto+0x3d7/0x670 net/socket.c:1789 __do_sys_sendto net/socket.c:1801 [inline] __se_sys_sendto net/socket.c:1797 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1797 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801c80d4000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 144 bytes inside of 512-byte region [ffff8801c80d4000, ffff8801c80d4200) The buggy address belongs to the page: page:ffffea0007203500 count:1 mapcount:0 mapping:ffff8801c80d4000 index:0xffff8801c80d4280 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c80d4000 ffff8801c80d4280 0000000100000005 raw: ffffea0006a79260 ffffea00073aba60 ffff8801da800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c80d3f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c80d4000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c80d4080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c80d4100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c80d4180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================