bisecting fixing commit since dce0f88600e49746b4bda873965b671a23ff4313 building syzkaller on ada108d08bee29122bf15427630464265c555cbc testing commit dce0f88600e49746b4bda873965b671a23ff4313 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: a43417927e3453ac1f913f26b79dc964096f453b70cca5826a80cd6f0d8ca18e run #0: crashed: KASAN: use-after-free Write in tls_push_record run #1: crashed: KASAN: slab-out-of-bounds Write in tls_push_record run #2: crashed: KASAN: out-of-bounds Write in tls_push_record run #3: crashed: KASAN: use-after-free Write in tls_push_record run #4: crashed: KASAN: use-after-free Write in tls_push_record run #5: crashed: KASAN: use-after-free Write in tls_push_record run #6: crashed: KASAN: use-after-free Write in tls_push_record run #7: crashed: KASAN: use-after-free Write in tls_push_record run #8: crashed: KASAN: use-after-free Write in tls_push_record run #9: crashed: KASAN: out-of-bounds Write in tls_push_record run #10: crashed: KASAN: use-after-free Write in tls_push_record run #11: crashed: KASAN: use-after-free Write in tls_push_record run #12: crashed: KASAN: use-after-free Write in tls_push_record run #13: crashed: KASAN: use-after-free Write in tls_push_record run #14: crashed: KASAN: use-after-free Write in tls_push_record run #15: crashed: WARNING in sk_stream_kill_queues run #16: crashed: KASAN: out-of-bounds Write in tls_push_record run #17: crashed: KASAN: use-after-free Write in tls_push_record run #18: crashed: KASAN: use-after-free Write in tls_push_record run #19: crashed: KASAN: use-after-free Write in tls_push_record testing current HEAD 6ca2f514c57864e3085a65c5e9d2adca4144bc4c testing commit 6ca2f514c57864e3085a65c5e9d2adca4144bc4c compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 34c41dfc0e000fce457757731f74b7519b6ba5f1e13be0d9cb14b4f71b1edde2 run #0: crashed: KASAN: use-after-free Write in tls_push_record run #1: crashed: KASAN: use-after-free Write in tls_push_record run #2: crashed: KASAN: slab-out-of-bounds Write in tls_push_record run #3: crashed: KASAN: use-after-free Write in tls_push_record run #4: crashed: KASAN: use-after-free Write in tls_push_record run #5: crashed: KASAN: use-after-free Write in tls_push_record run #6: crashed: KASAN: use-after-free Write in tls_push_record run #7: crashed: KASAN: use-after-free Write in tls_push_record run #8: crashed: WARNING in sk_stream_kill_queues run #9: crashed: KASAN: use-after-free Write in tls_push_record revisions tested: 2, total time: 27m54.720005379s (build: 20m45.359062865s, test: 6m32.168916625s) the crash still happens on HEAD commit msg: Linux 4.19.201 crash: KASAN: use-after-free Write in tls_push_record CPU: 1 PID: 7316 Comm: syz-executor.1 Not tainted 4.19.201-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+0x17c/0x226 lib/dump_stack.c:118 BUG: KASAN: use-after-free in tls_fill_prepend include/net/tls.h:379 [inline] BUG: KASAN: use-after-free in tls_push_record+0x116e/0x15f0 net/tls/tls_sw.c:220 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.2+0x5/0xa lib/fault-inject.c:149 Write of size 1 at addr ffff8881edbd8000 by task syz-executor.3/7298 __should_failslab+0xba/0xf0 mm/failslab.c:32 should_failslab+0x9/0x20 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc_node mm/slab.c:3304 [inline] kmem_cache_alloc_node+0x25a/0x3e0 mm/slab.c:3647 __alloc_skb+0xa7/0x580 net/core/skbuff.c:193 alloc_skb_fclone include/linux/skbuff.h:1037 [inline] sk_stream_alloc_skb+0x9e/0x800 net/ipv4/tcp.c:884 tcp_sendmsg_locked+0xa07/0x3710 net/ipv4/tcp.c:1312 tcp_sendmsg+0x27/0x40 net/ipv4/tcp.c:1462 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:661 __sys_sendto+0x1f2/0x2e0 net/socket.c:1897 __do_sys_sendto net/socket.c:1909 [inline] __se_sys_sendto net/socket.c:1905 [inline] __x64_sys_sendto+0xdc/0x1a0 net/socket.c:1905 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4645a9 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:00007fcd33523198 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004645a9 RDX: 00000000e0ffffff RSI: 00000000200005c0 RDI: 0000000000000003 RBP: 000000000051d8e0 R08: 0000000000000000 R09: 00000000000000d8 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bfa0 R13: 00007fcd335236bc R14: 0000000000000005 R15: 0000000000000001 CPU: 0 PID: 7298 Comm: syz-executor.3 Not tainted 4.19.201-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+0x17c/0x226 lib/dump_stack.c:118 print_address_description.cold.6+0x9/0x211 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:396 __asan_report_store1_noabort+0x17/0x20 mm/kasan/report.c:435 tls_fill_prepend include/net/tls.h:379 [inline] tls_push_record+0x116e/0x15f0 net/tls/tls_sw.c:220 tls_sw_push_pending_record+0xe/0x10 net/tls/tls_sw.c:257 tls_push_pending_closed_record net/tls/tls_main.c:203 [inline] tls_push_pending_closed_record+0xbc/0x100 net/tls/tls_main.c:196 tls_complete_pending_work include/net/tls.h:309 [inline] tls_sk_proto_close+0x479/0x980 net/tls/tls_main.c:270 inet_release+0xb4/0x1b0 net/ipv4/af_inet.c:427 inet6_release+0x46/0x60 net/ipv6/af_inet6.c:472 __sock_release+0xc2/0x290 net/socket.c:599 sock_close+0x10/0x20 net/socket.c:1212 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 page:ffffea000749fc00 count:0 mapcount:-128 mapping:0000000000000000 index:0x0 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa6a/0x2d90 kernel/exit.c:870 do_group_exit+0xf8/0x2c0 kernel/exit.c:967 flags: 0x17ffe0000000000() get_signal+0x30b/0x1970 kernel/signal.c:2589 raw: 017ffe0000000000 ffffea0007478608 ffffea0007832408 0000000000000000 do_signal+0x87/0x1870 arch/x86/kernel/signal.c:799 raw: 0000000000000000 0000000000000003 00000000ffffff7f 0000000000000000 exit_to_usermode_loop+0x159/0x1e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x413/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4645a9 page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0) Code: Bad RIP value. ------------[ cut here ]------------ RSP: 002b:00007f8052add198 EFLAGS: 00000246 ORIG_RAX: 000000000000002c kernel BUG at include/linux/mm.h:519! RAX: 0000000000004000 RBX: 0000000000000000 RCX: 00000000004645a9 RDX: 00000000e0ffffff RSI: 00000000200005c0 RDI: 0000000000000003 RBP: 000000000051d8e0 R08: 0000000000000000 R09: 00000000000000d8 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bf00 R13: 00007f8052add6bc R14: 0000000000000005 R15: 0000000000000001 CPU: 1 PID: 7317 Comm: syz-executor.4 Not tainted 4.19.201-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 The buggy address belongs to the page: Call Trace: page:ffffea0007b6f600 count:0 mapcount:-128 mapping:0000000000000000 index:0x0 __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 flags: 0x17ffe0000000000() fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.2+0x5/0xa lib/fault-inject.c:149 raw: 017ffe0000000000 ffffea0007454c08 ffffea000748fa08 0000000000000000 raw: 0000000000000000 0000000000000003 00000000ffffff7f 0000000000000000 __should_failslab+0xba/0xf0 mm/failslab.c:32 page dumped because: kasan: bad access detected should_failslab+0x9/0x20 mm/slab_common.c:1590 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc_node mm/slab.c:3304 [inline] kmem_cache_alloc_node+0x25a/0x3e0 mm/slab.c:3647 Memory state around the buggy address: __alloc_skb+0xa7/0x580 net/core/skbuff.c:193 ffff8881edbd7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881edbd7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881edbd8000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881edbd8080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881edbd8100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== alloc_skb_fclone include/linux/skbuff.h:1037 [inline] sk_stream_alloc_skb+0x9e/0x800 net/ipv4/tcp.c:884 tcp_sendmsg_locked+0xa07/0x3710 net/ipv4/tcp.c:1312 page:ffffea0007b6f600 count:0 mapcount:-128 mapping:0000000000000000 index:0x0 flags: 0x17ffe0000000000() tcp_sendmsg+0x27/0x40 net/ipv4/tcp.c:1462 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:661 __sys_sendto+0x1f2/0x2e0 net/socket.c:1897 raw: 017ffe0000000000 ffffea0007454c08 ffffea000748fa08 0000000000000000 raw: 0000000000000000 0000000000000003 00000000ffffff7f 0000000000000000 __do_sys_sendto net/socket.c:1909 [inline] __se_sys_sendto net/socket.c:1905 [inline] __x64_sys_sendto+0xdc/0x1a0 net/socket.c:1905 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4645a9 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:00007f881e579198 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00000000004645a9 RDX: 00000000e0ffffff RSI: 00000000200005c0 RDI: 0000000000000003 page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0) RBP: 000000000051d8e0 R08: 0000000000000000 R09: 00000000000000d8 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bfa0 R13: 00007f881e5796bc R14: 0000000000000005 R15: 0000000000000001 invalid opcode: 0000 [#1] PREEMPT SMP KASAN ------------[ cut here ]------------ CPU: 1 PID: 7304 Comm: syz-executor.5 Tainted: G B 4.19.201-syzkaller #0 kernel BUG at include/linux/mm.h:519! Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:put_page_testzero include/linux/mm.h:519 [inline] RIP: 0010:put_page include/linux/mm.h:962 [inline] RIP: 0010:tls_sk_proto_close+0x63e/0x980 net/tls/tls_main.c:277 Code: 5f 7c ff 48 8b b5 50 ff ff ff 4c 89 ff 48 8b 85 58 ff ff ff ff d0 e9 0c ff ff ff 48 c7 c6 00 be c9 87 4c 89 f7 e8 32 b8 b1 fb <0f> 0b be 00 00 10 00 4c 89 ff e8 63 ce 7b ff e9 8e fd ff ff 49 8d RSP: 0018:ffff8881edf97860 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff8881e969f000 RCX: 0000000000000000 RDX: 1ffffd4000e93f87 RSI: 0000000000000000 RDI: ffffea000749fc38 RBP: ffff8881edf97920 R08: ffffed103ed23eef R09: ffffed103ed23eee R10: ffffed103ed23eee R11: ffff8881f691f777 R12: ffff8881ee284c20 R13: dffffc0000000000 R14: ffffea000749fc00 R15: ffff8881d996ce00 FS: 00007f29d197c700(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fd640c3a000 CR3: 000000000846d001 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: inet_release+0xb4/0x1b0 net/ipv4/af_inet.c:427 inet6_release+0x46/0x60 net/ipv6/af_inet6.c:472 __sock_release+0xc2/0x290 net/socket.c:599 sock_close+0x10/0x20 net/socket.c:1212 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa6a/0x2d90 kernel/exit.c:870 do_group_exit+0xf8/0x2c0 kernel/exit.c:967 get_signal+0x30b/0x1970 kernel/signal.c:2589 do_signal+0x87/0x1870 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x159/0x1e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x413/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4645a9 Code: Bad RIP value. RSP: 002b:00007f29d197c198 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: 0000000000004000 RBX: 0000000000000000 RCX: 00000000004645a9 RDX: 00000000e0ffffff RSI: 00000000200005c0 RDI: 0000000000000003 RBP: 000000000051d8e0 R08: 0000000000000000 R09: 00000000000000d8 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bf00 R13: 00007f29d197c6bc R14: 0000000000000005 R15: 0000000000000001 Modules linked in: invalid opcode: 0000 [#2] PREEMPT SMP KASAN CPU: 0 PID: 7298 Comm: syz-executor.3 Tainted: G B D 4.19.201-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:put_page_testzero include/linux/mm.h:519 [inline] RIP: 0010:put_page include/linux/mm.h:962 [inline] RIP: 0010:tls_sk_proto_close+0x63e/0x980 net/tls/tls_main.c:277 Code: 5f 7c ff 48 8b b5 50 ff ff ff 4c 89 ff 48 8b 85 58 ff ff ff ff d0 e9 0c ff ff ff 48 c7 c6 00 be c9 87 4c 89 f7 e8 32 b8 b1 fb <0f> 0b be 00 00 10 00 4c 89 ff e8 63 ce 7b ff e9 8e fd ff ff 49 8d RSP: 0018:ffff8881edfcf860 EFLAGS: 00010246 RAX: dffffc0000000000 RBX: ffff8881d406c0c0 RCX: 0000000000000001 RDX: 1ffffd4000f6dec7 RSI: 0000000000000000 RDI: ffffea0007b6f638 RBP: ffff8881edfcf920 R08: ffffed103ed05081 R09: ffffed103ed05080 ---[ end trace 4efb06e4d50fb705 ]--- R10: ffffed103ed05080 R11: ffff8881f6828407 R12: ffff8881d2226fe0 R13: dffffc0000000000 R14: ffffea0007b6f600 R15: ffff8881d4f50ec0 FS: 00007f8052add700(0000) GS:ffff8881f6800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055a30e239e28 CR3: 000000000846d005 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: inet_release+0xb4/0x1b0 net/ipv4/af_inet.c:427 inet6_release+0x46/0x60 net/ipv6/af_inet6.c:472 RIP: 0010:put_page_testzero include/linux/mm.h:519 [inline] RIP: 0010:put_page include/linux/mm.h:962 [inline] RIP: 0010:tls_sk_proto_close+0x63e/0x980 net/tls/tls_main.c:277 __sock_release+0xc2/0x290 net/socket.c:599 sock_close+0x10/0x20 net/socket.c:1212 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x108/0x180 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa6a/0x2d90 kernel/exit.c:870 do_group_exit+0xf8/0x2c0 kernel/exit.c:967 get_signal+0x30b/0x1970 kernel/signal.c:2589 do_signal+0x87/0x1870 arch/x86/kernel/signal.c:799 exit_to_usermode_loop+0x159/0x1e0 arch/x86/entry/common.c:163 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x413/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4645a9 Code: Bad RIP value. RSP: 002b:00007f8052add198 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: 0000000000004000 RBX: 0000000000000000 RCX: 00000000004645a9 RDX: 00000000e0ffffff RSI: 00000000200005c0 RDI: 0000000000000003 RBP: 000000000051d8e0 R08: 0000000000000000 R09: 00000000000000d8 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bf00 R13: 00007f8052add6bc R14: 0000000000000005 R15: 0000000000000001 Modules linked in: Code: 5f 7c ff 48 8b b5 50 ff ff ff 4c 89 ff 48 8b 85 58 ff ff ff ff d0 e9 0c ff ff ff 48 c7 c6 00 be c9 87 4c 89 f7 e8 32 b8 b1 fb <0f> 0b be 00 00 10 00 4c 89 ff e8 63 ce 7b ff e9 8e fd ff ff 49 8d TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. ---[ end trace 4efb06e4d50fb706 ]--- TCP: request_sock_TCPv6: Possible SYN flooding on port 20002. Sending cookies. Check SNMP counters. RIP: 0010:put_page_testzero include/linux/mm.h:519 [inline] RIP: 0010:put_page include/linux/mm.h:962 [inline] RIP: 0010:tls_sk_proto_close+0x63e/0x980 net/tls/tls_main.c:277 RSP: 0018:ffff8881edf97860 EFLAGS: 00010246 Code: 5f 7c ff 48 8b b5 50 ff ff ff 4c 89 ff 48 8b 85 58 ff ff ff ff d0 e9 0c ff ff ff 48 c7 c6 00 be c9 87 4c 89 f7 e8 32 b8 b1 fb <0f> 0b be 00 00 10 00 4c 89 ff e8 63 ce 7b ff e9 8e fd ff ff 49 8d RAX: dffffc0000000000 RBX: ffff8881e969f000 RCX: 0000000000000000 RSP: 0018:ffff8881edf97860 EFLAGS: 00010246 RDX: 1ffffd4000e93f87 RSI: 0000000000000000 RDI: ffffea000749fc38 RAX: dffffc0000000000 RBX: ffff8881e969f000 RCX: 0000000000000000 RBP: ffff8881edf97920 R08: ffffed103ed23eef R09: ffffed103ed23eee RDX: 1ffffd4000e93f87 RSI: 0000000000000000 RDI: ffffea000749fc38 R10: ffffed103ed23eee R11: ffff8881f691f777 R12: ffff8881ee284c20 RBP: ffff8881edf97920 R08: ffffed103ed23eef R09: ffffed103ed23eee R13: dffffc0000000000 R14: ffffea000749fc00 R15: ffff8881d996ce00 FS: 00007f29d197c700(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fcd33522f88 CR3: 000000000846d002 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400