================================================================== BUG: KASAN: slab-out-of-bounds in _copy_to_user+0x9a/0xc0 lib/usercopy.c:27 Read of size 337 at addr ffff8801c6e5fffd by task syz-executor0/27190 CPU: 1 PID: 27190 Comm: syz-executor0 Not tainted 4.14.74+ #17 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x11b lib/dump_stack.c:53 print_address_description+0x60/0x22b mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409 _copy_to_user+0x9a/0xc0 lib/usercopy.c:27 copy_to_user include/linux/uaccess.h:155 [inline] bpf_test_finish.isra.0+0xc8/0x190 net/bpf/test_run.c:59 bpf_prog_test_run_skb+0x4d0/0x8c0 net/bpf/test_run.c:144 bpf_prog_test_run kernel/bpf/syscall.c:1330 [inline] SYSC_bpf kernel/bpf/syscall.c:1602 [inline] SyS_bpf+0x79d/0x3640 kernel/bpf/syscall.c:1547 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x457579 RSP: 002b:00007f0fb903ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457579 RDX: 0000000000000028 RSI: 0000000020000180 RDI: 000000000000000a RBP: 000000000072c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0fb903b6d4 R13: 00000000004bd8a6 R14: 00000000004cc208 R15: 00000000ffffffff Allocated by task 25728: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551 slab_post_alloc_hook mm/slab.h:442 [inline] slab_alloc_node mm/slub.c:2723 [inline] slab_alloc mm/slub.c:2731 [inline] __kmalloc_track_caller+0x104/0x300 mm/slub.c:4288 __kmalloc_reserve.isra.8+0x2f/0xc0 net/core/skbuff.c:137 __alloc_skb+0x105/0x550 net/core/skbuff.c:205 alloc_skb_fclone include/linux/skbuff.h:1022 [inline] sk_stream_alloc_skb+0xe7/0x7c0 net/ipv4/tcp.c:855 tcp_sendmsg_locked+0xef4/0x3250 net/ipv4/tcp.c:1284 tcp_sendmsg+0x2a/0x40 net/ipv4/tcp.c:1446 inet_sendmsg+0x168/0x540 net/ipv4/af_inet.c:781 sock_sendmsg_nosec net/socket.c:645 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:655 SYSC_sendto net/socket.c:1762 [inline] SyS_sendto+0x211/0x340 net/socket.c:1730 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 25728: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kfree+0xf5/0x310 mm/slub.c:3897 skb_free_head+0x83/0xa0 net/core/skbuff.c:550 skb_release_data+0x495/0x610 net/core/skbuff.c:570 skb_release_all+0x46/0x60 net/core/skbuff.c:627 __kfree_skb+0x11/0x20 net/core/skbuff.c:641 sk_wmem_free_skb include/net/sock.h:1406 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3167 [inline] tcp_ack+0x18e3/0x4110 net/ipv4/tcp_input.c:3666 tcp_rcv_established+0x4a8/0x1660 net/ipv4/tcp_input.c:5540 tcp_v4_do_rcv+0x55f/0x6f0 net/ipv4/tcp_ipv4.c:1464 sk_backlog_rcv include/net/sock.h:902 [inline] __release_sock+0x135/0x350 net/core/sock.c:2261 release_sock+0x54/0x1b0 net/core/sock.c:2773 sk_stream_wait_memory+0x4ae/0xc30 net/core/stream.c:149 tcp_sendmsg_locked+0x11db/0x3250 net/ipv4/tcp.c:1399 tcp_sendmsg+0x2a/0x40 net/ipv4/tcp.c:1446 inet_sendmsg+0x168/0x540 net/ipv4/af_inet.c:781 sock_sendmsg_nosec net/socket.c:645 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:655 SYSC_sendto net/socket.c:1762 [inline] SyS_sendto+0x211/0x340 net/socket.c:1730 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8801c6e5fa80 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 381 bytes to the right of 1024-byte region [ffff8801c6e5fa80, ffff8801c6e5fe80) The buggy address belongs to the page: page:ffffea00071b9700 count:1 mapcount:0 mapping: (null) index:0xffff8801c6e5d200 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 ffff8801c6e5d200 00000001000e0002 raw: ffffea0007561320 ffffea00070bad20 ffff8801da802a00 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c6e5fe80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8801c6e5ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c6e5ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8801c6e60000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8801c6e60080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================