================================================================== BUG: KASAN: use-after-free in tls_fill_prepend include/net/tls.h:379 [inline] BUG: KASAN: use-after-free in tls_push_record+0x104c/0x1370 net/tls/tls_sw.c:220 Write of size 1 at addr ffff8880b0338000 by task syz-executor.2/6540 CPU: 0 PID: 6540 Comm: syz-executor.2 Not tainted 4.19.211-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+0x1fc/0x2ef lib/dump_stack.c:118 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354 kasan_report mm/kasan/report.c:412 [inline] __asan_report_store1_noabort+0x88/0x90 mm/kasan/report.c:435 tls_fill_prepend include/net/tls.h:379 [inline] tls_push_record+0x104c/0x1370 net/tls/tls_sw.c:220 tls_push_pending_closed_record net/tls/tls_main.c:203 [inline] tls_push_pending_closed_record net/tls/tls_main.c:196 [inline] tls_write_space+0x2c6/0x320 net/tls/tls_main.c:231 tcp_new_space net/ipv4/tcp_input.c:5167 [inline] tcp_check_space+0x407/0x6f0 net/ipv4/tcp_input.c:5178 tcp_data_snd_check net/ipv4/tcp_input.c:5188 [inline] tcp_rcv_established+0x916/0x1ef0 net/ipv4/tcp_input.c:5681 tcp_v6_do_rcv+0xe1e/0x1370 net/ipv6/tcp_ipv6.c:1348 sk_backlog_rcv include/net/sock.h:952 [inline] __release_sock+0x134/0x3a0 net/core/sock.c:2362 release_sock+0x54/0x1b0 net/core/sock.c:2901 tls_sw_sendmsg+0xdea/0x1210 net/tls/tls_sw.c:500 inet_sendmsg+0x132/0x5a0 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xc3/0x120 net/socket.c:661 __sys_sendto+0x21a/0x320 net/socket.c:1899 __do_sys_sendto net/socket.c:1911 [inline] __se_sys_sendto net/socket.c:1907 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:1907 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7f2b6c261e99 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2b6abd7168 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f2b6c374f60 RCX: 00007f2b6c261e99 RDX: 00000000e0ffffff RSI: 00000000200005c0 RDI: 0000000000000003 RBP: 00007f2b6abd71d0 R08: 0000000000000000 R09: 00000000000000d8 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002 R13: 00007ffd77deff8f R14: 00007f2b6abd7300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0002c0ce00 count:0 mapcount:-128 mapping:0000000000000000 index:0x0 flags: 0xfff00000000000() raw: 00fff00000000000 ffffea0001166a08 ffffea0002a11c08 0000000000000000 raw: 0000000000000000 0000000000000003 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880b0337f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880b0337f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880b0338000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880b0338080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880b0338100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================