TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. ================================================================== TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. BUG: KASAN: use-after-free in tls_write_space+0x2c2/0x360 net/tls/tls_main.c:225 Read of size 1 at addr ffff8801c5d810e0 by task syz-executor475/7108 TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. CPU: 1 PID: 7108 Comm: syz-executor475 Not tainted 4.18.0-rc4-next-20180710+ #3 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+0x1c9/0x2b4 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/0x30d mm/kasan/report.c:412 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430 tls_write_space+0x2c2/0x360 net/tls/tls_main.c:225 tcp_new_space net/ipv4/tcp_input.c:5081 [inline] tcp_check_space+0x551/0x930 net/ipv4/tcp_input.c:5092 tcp_data_snd_check net/ipv4/tcp_input.c:5102 [inline] tcp_rcv_established+0x8db/0x2180 net/ipv4/tcp_input.c:5581 tcp_v6_do_rcv+0x4b2/0x1450 net/ipv6/tcp_ipv6.c:1325 sk_backlog_rcv include/net/sock.h:931 [inline] __release_sock+0x12f/0x3a0 net/core/sock.c:2381 release_sock+0xad/0x2c0 net/core/sock.c:2894 tls_sk_proto_close+0x6e6/0xae0 net/tls/tls_main.c:302 inet_release+0x104/0x1f0 net/ipv4/af_inet.c:427 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:459 __sock_release+0xd7/0x260 net/socket.c:581 sock_close+0x19/0x20 net/socket.c:1132 __fput+0x35d/0x930 fs/file_table.c:252 ____fput+0x15/0x20 fs/file_table.c:288 task_work_run+0x1ec/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x407121 Code: 75 14 b8 03 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 b4 17 00 00 c3 48 83 ec 08 e8 6a fc ff ff 48 89 04 24 b8 03 00 00 00 0f 05 <48> 8b 3c 24 48 89 c2 e8 b3 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01 RSP: 002b:00007ffe90f67d60 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000003 RCX: 0000000000407121 RDX: 00000000004487f9 RSI: 0000000000000001 RDI: 0000000000000003 RBP: 0000000000000000 R08: 0000000000000016 R09: 0000000000000016 R10: 0000000000000016 R11: 0000000000000293 R12: 0000000000000000 R13: 0000000000001380 R14: 00007ffe90f67ea8 R15: 0000000000000003 Allocated by task 7113: 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 kmem_cache_alloc_trace+0x152/0x780 mm/slab.c:3620 kmalloc include/linux/slab.h:513 [inline] kzalloc include/linux/slab.h:707 [inline] create_ctx net/tls/tls_main.c:535 [inline] tls_init+0x1e7/0xb20 net/tls/tls_main.c:659 tcp_set_ulp+0x1bc/0x520 net/ipv4/tcp_ulp.c:153 do_tcp_setsockopt.isra.41+0x44a/0x2680 net/ipv4/tcp.c:2747 tcp_setsockopt+0xc1/0xe0 net/ipv4/tcp.c:3058 sock_common_setsockopt+0x9a/0xe0 net/core/sock.c:3083 __sys_setsockopt+0x1c5/0x3b0 net/socket.c:1893 __do_sys_setsockopt net/socket.c:1904 [inline] __se_sys_setsockopt net/socket.c:1901 [inline] __x64_sys_setsockopt+0xbe/0x150 net/socket.c:1901 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7108: 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 tls_sk_proto_close+0x712/0xae0 net/tls/tls_main.c:297 inet_release+0x104/0x1f0 net/ipv4/af_inet.c:427 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:459 __sock_release+0xd7/0x260 net/socket.c:581 sock_close+0x19/0x20 net/socket.c:1132 __fput+0x35d/0x930 fs/file_table.c:252 ____fput+0x15/0x20 fs/file_table.c:288 task_work_run+0x1ec/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801c5d81000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 224 bytes inside of 512-byte region [ffff8801c5d81000, ffff8801c5d81200) The buggy address belongs to the page: page:ffffea0007176040 count:1 mapcount:0 mapping:ffff8801da800940 index:0xffff8801c5d81780 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea00071f9d08 ffffea0006d15188 ffff8801da800940 raw: ffff8801c5d81780 ffff8801c5d81000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c5d80f80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8801c5d81000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801c5d81080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c5d81100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c5d81180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================