bisecting fixing commit since dce0f88600e49746b4bda873965b671a23ff4313 building syzkaller on ada108d08bee29122bf15427630464265c555cbc testing commit dce0f88600e49746b4bda873965b671a23ff4313 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 7d576469a49701cf2e64f5b34ae9b1af847d646853d417bbed7a8bf6a0d14e50 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: 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: KASAN: use-after-free Write in tls_push_record run #9: crashed: WARNING in sk_stream_kill_queues run #10: crashed: KASAN: slab-out-of-bounds Write in tls_push_record run #11: crashed: KASAN: out-of-bounds 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: slab-out-of-bounds Write in tls_push_record run #15: crashed: KASAN: use-after-free Write in tls_push_record run #16: crashed: KASAN: out-of-bounds Write in tls_push_record run #17: crashed: KASAN: out-of-bounds 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 2950c9c5e0df6bd34af45a5168bbee345e95eae2 testing commit 2950c9c5e0df6bd34af45a5168bbee345e95eae2 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 83c00a05001d59abf266d96ded93d5da2adabd112d32094a7cbf5c83a12b711d run #0: crashed: KASAN: out-of-bounds Write in tls_push_record run #1: crashed: KASAN: use-after-free Write in tls_push_record run #2: crashed: KASAN: use-after-free Write in tls_push_record run #3: crashed: KASAN: use-after-free Write in tls_push_record run #4: crashed: KASAN: slab-out-of-bounds Write in tls_push_record run #5: crashed: KASAN: use-after-free Write in tls_push_record run #6: crashed: KASAN: out-of-bounds Write in tls_push_record run #7: crashed: KASAN: out-of-bounds Write in tls_push_record run #8: crashed: KASAN: slab-out-of-bounds Write in tls_push_record run #9: crashed: KASAN: use-after-free Write in tls_push_record revisions tested: 2, total time: 28m34.319522817s (build: 21m12.962076583s, test: 6m44.829966888s) the crash still happens on HEAD commit msg: Linux 4.19.207 crash: KASAN: use-after-free Write in tls_push_record RBP: 000000000051d8e0 R08: 0000000000000000 R09: 00000000000000d8 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000055bfa0 R13: 00007f3804a0b6bc R14: 0000000000000005 R15: 0000000000000001 ================================================================== batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 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 Write of size 1 at addr ffff8881d9eb8000 by task syz-executor.2/7153 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! CPU: 1 PID: 7153 Comm: syz-executor.2 Not tainted 4.19.207-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 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 __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 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! 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 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 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:1214 __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 get_signal+0x1352/0x1970 kernel/signal.c:2400 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: 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:00007f02007d1198 EFLAGS: 00000246 ORIG_RAX: 000000000000002c batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! 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: 00007f02007d16bc R14: 0000000000000005 R15: 0000000000000001 The buggy address belongs to the page: page:ffffea000767ae00 count:1 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x17ffe0000000000() raw: 017ffe0000000000 dead000000000100 dead000000000200 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d9eb7f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d9eb7f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881d9eb8000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff8881d9eb8080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881d9eb8100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== ------------[ cut here ]------------ batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! WARNING: CPU: 1 PID: 7153 at net/core/stream.c:208 sk_stream_kill_queues.cold.1+0xc/0x39 net/core/stream.c:208 batman_adv: The newly added mac address (aa:aa:aa:aa:aa:3e) already exists on: batadv_slave_1 Modules linked in: CPU: 1 PID: 7153 Comm: syz-executor.2 Tainted: G B 4.19.207-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:sk_stream_kill_queues.cold.1+0xc/0x39 net/core/stream.c:208 Code: 8a ed ff 0f 0b 44 8b 95 40 ff ff ff 8b 8d 38 ff ff ff 44 8b 8d 30 ff ff ff e9 62 36 7d fe 48 c7 c7 c0 6f c0 87 e8 d6 8a ed ff <0f> 0b e9 b4 68 7d fe 48 c7 c7 c0 6f c0 87 e8 c3 8a ed ff 0f 0b e9 RSP: 0018:ffff8881da31f940 EFLAGS: 00010286 RAX: 0000000000000024 RBX: ffff8881d9e3af70 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff8767a520 RDI: ffffffff8a199aa0 RBP: ffff8881da31f980 R08: ffffed103ed25091 R09: ffffed103ed25090 R10: ffffed103ed25090 R11: ffff8881f6928487 R12: ffff8881d9e3ad80 R13: ffff8881d9e3af08 R14: 0000000000000007 R15: ffff8881d9e3ad80 FS: 00007f02007d1700(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2d40036058 CR3: 00000001dc9cb002 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: inet_csk_destroy_sock+0x129/0x390 net/ipv4/inet_connection_sock.c:877 tcp_close+0x821/0xf00 net/ipv4/tcp.c:2498 tls_sk_proto_close+0x62a/0x980 net/tls/tls_main.c:312 inet_release+0xb4/0x1b0 net/ipv4/af_inet.c:427 batman_adv: It is strongly recommended to keep mac addresses unique to avoid problems! 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:1214 __fput+0x249/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready task_work_run+0x108/0x180 kernel/task_work.c:113 get_signal+0x1352/0x1970 kernel/signal.c:2400 batman_adv: batadv0: Interface activated: batadv_slave_1 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: 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:00007f02007d1198 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: 00007f02007d16bc R14: 0000000000000005 R15: 0000000000000001 irq event stamp: 2736 hardirqs last enabled at (2735): [] __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:160 [inline] hardirqs last enabled at (2735): [] _raw_spin_unlock_irqrestore+0x82/0xd0 kernel/locking/spinlock.c:184 hardirqs last disabled at (2736): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (2736): [] _raw_spin_lock_irqsave+0x74/0xd0 kernel/locking/spinlock.c:152 softirqs last enabled at (2728): [] lock_sock_nested+0x82/0x100 net/core/sock.c:2867 softirqs last disabled at (2726): [] spin_lock_bh include/linux/spinlock.h:334 [inline] softirqs last disabled at (2726): [] lock_sock_nested+0x3a/0x100 net/core/sock.c:2864 ---[ end trace dafe23d83d9be3ba ]--- ------------[ cut here ]------------ FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 WARNING: CPU: 1 PID: 7153 at net/ipv4/af_inet.c:156 inet_sock_destruct.cold.3+0x9d/0xa4 net/ipv4/af_inet.c:156