bisecting fixing commit since 2d19be4653f5e74ed95560b69f94eb6791d49af3 building syzkaller on 4c37c133e4bf703d023995535f1e264d8658e08e testing commit 2d19be4653f5e74ed95560b69f94eb6791d49af3 with gcc (GCC) 8.4.1 20210217 kernel signature: d96aea74c824557737aa131be79ec9389cb437e8907b02f29461cf58cd7cc181 run #0: crashed: general protection fault in tls_sk_proto_close run #1: crashed: general protection fault in tls_sk_proto_close run #2: crashed: general protection fault in tls_sk_proto_close run #3: crashed: BUG: Bad page state run #4: crashed: kernel BUG in do_exit run #5: crashed: BUG: Bad page state run #6: crashed: general protection fault in tls_sk_proto_close run #7: crashed: general protection fault in tls_sk_proto_close run #8: crashed: kernel panic: corrupted stack end in corrupted run #9: crashed: general protection fault in tls_sk_proto_close run #10: crashed: kernel panic: corrupted stack end in corrupted run #11: crashed: kernel BUG in corrupted run #12: crashed: general protection fault in tls_sk_proto_close run #13: crashed: general protection fault in tls_sk_proto_close run #14: crashed: general protection fault in corrupted run #15: crashed: general protection fault in tls_sk_proto_close run #16: crashed: general protection fault in tls_sk_proto_close run #17: crashed: KASAN: slab-out-of-bounds Read in __schedule run #18: crashed: general protection fault in tls_sk_proto_close run #19: crashed: kernel panic: corrupted stack end in corrupted testing current HEAD eb575cd5d7f60241d016fdd13a9e86d962093c9b testing commit eb575cd5d7f60241d016fdd13a9e86d962093c9b with gcc (GCC) 8.4.1 20210217 kernel signature: 955ea81888fcc5881045567dbdaa78cf32cfb817fee16cc004bc808a3939d11b run #0: crashed: general protection fault in netlink_recvmsg run #1: crashed: general protection fault in tls_sk_proto_close run #2: crashed: general protection fault in tls_sk_proto_close run #3: crashed: BUG: Bad page state run #4: crashed: BUG: Bad page state run #5: crashed: KASAN: slab-out-of-bounds Read in __schedule run #6: crashed: general protection fault in tls_sk_proto_close run #7: crashed: BUG: Bad page state run #8: crashed: general protection fault in tls_sk_proto_close run #9: crashed: BUG: Bad page state revisions tested: 2, total time: 21m40.756825621s (build: 14m49.668324814s, test: 6m30.231599485s) the crash still happens on HEAD commit msg: Linux 4.19.195 crash: BUG: Bad page state RBP: 00007fe5592e01d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000004000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffffa360f4f R14: 00007fe5592e0300 R15: 0000000000022000 wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 kasan: CONFIG_KASAN_INLINE enabled BUG: Bad page state in process syz-executor.5 pfn:99098 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 kasan: GPF could be caused by NULL-ptr deref or user memory access page:ffffea0002642600 count:0 mapcount:0 mapping:ffff88813be46080 index:0x0 compound_mapcount: 0 CPU: 0 PID: 9879 Comm: syz-executor.3 Not tainted 4.19.195-syzkaller #0 general protection fault: 0000 [#1] PREEMPT SMP KASAN Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 CPU: 1 PID: 9840 Comm: syz-executor.5 Not tainted 4.19.195-syzkaller #0 Call Trace: Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 RIP: 0010:__read_once_size include/linux/compiler.h:261 [inline] RIP: 0010:compound_head include/linux/page-flags.h:142 [inline] RIP: 0010:put_page include/linux/mm.h:951 [inline] RIP: 0010:tls_sk_proto_close+0x2af/0x980 net/tls/tls_main.c:277 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.2+0x5/0xa lib/fault-inject.c:149 Code: 89 ca 48 89 8d 40 ff ff ff 48 c1 ea 03 4a 8d 0c 2a 48 89 8d 68 ff ff ff 48 83 e0 fc 48 8d 78 08 49 89 c6 48 89 fe 48 c1 ee 03 <42> 80 3c 2e 00 0f 85 63 05 00 00 49 8b 76 08 48 8d 7e ff 83 e6 01 RSP: 0018:ffff888097cb7ca0 EFLAGS: 00010202 __should_failslab+0xba/0xf0 mm/failslab.c:32 RAX: 0000000000000000 RBX: ffff888099215040 RCX: ffffed1012f86dad should_failslab+0x9/0x20 mm/slab_common.c:1588 RDX: 1ffffffff1322499 RSI: 0000000000000001 RDI: 0000000000000008 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] __do_kmalloc mm/slab.c:3725 [inline] __kmalloc+0x2b5/0x3d0 mm/slab.c:3736 RBP: ffff888097cb7d60 R08: ffff88809beb4ed0 R09: 1ffffffff18c53ea R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880997b93c0 kmalloc include/linux/slab.h:520 [inline] aead_request_alloc include/crypto/aead.h:427 [inline] tls_push_record+0xff/0x15f0 net/tls/tls_sw.c:209 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff888097c36d40 FS: 0000000002aed400(0000) GS:ffff8880ba300000(0000) knlGS:0000000000000000 tls_sw_sendmsg+0xb35/0x1010 net/tls/tls_sw.c:467 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055a655527238 CR3: 00000000b50fc000 CR4: 00000000001406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 inet_release+0xb4/0x1b0 net/ipv4/af_inet.c:427 inet6_release+0x46/0x60 net/ipv6/af_inet6.c:472 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xac/0xf0 net/socket.c:632 __sock_release+0xc2/0x290 net/socket.c:579 __sys_sendto+0x1f2/0x2e0 net/socket.c:1787 sock_close+0x10/0x20 net/socket.c:1140 __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 tracehook_notify_resume include/linux/tracehook.h:193 [inline] exit_to_usermode_loop+0x185/0x1e0 arch/x86/entry/common.c:167 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:0x41920b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007ffffa360fb0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 000000000041920b RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003 __do_sys_sendto net/socket.c:1799 [inline] __se_sys_sendto net/socket.c:1795 [inline] __x64_sys_sendto+0xdc/0x1a0 net/socket.c:1795 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000001b2bf200fc do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 R10: 0000000000000000 R11: 0000000000000293 R12: 000000000056c9e0 entry_SYSCALL_64_after_hwframe+0x49/0xbe R13: 000000000056c9e0 R14: 000000000056bf60 R15: 000000000000c8e5 RIP: 0033:0x465ef9 Modules linked in: 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 flags: 0xfff00000008100(slab|head) RSP: 002b:00007f5b10e27188 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000056bf60 RCX: 0000000000465ef9 RDX: 0000000000000001 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007f5b10e271d0 R08: 0000000000000000 R09: 0000000000000000 raw: 00fff00000008100 ffffea0002693788 ffffea0002642688 ffff88813be46080 R10: 0000000000004000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffc57cc925f R14: 00007f5b10e27300 R15: 0000000000022000 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 Bluetooth: hci2: command 0x0419 tx timeout ---[ end trace 6d52b7c0f292f5d3 ]--- Bluetooth: hci1: command 0x0419 tx timeout IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready raw: 0000000000000000 ffff888099098b40 0000000000000001 0000000000000000 RIP: 0010:__read_once_size include/linux/compiler.h:261 [inline] RIP: 0010:compound_head include/linux/page-flags.h:142 [inline] RIP: 0010:put_page include/linux/mm.h:951 [inline] RIP: 0010:tls_sk_proto_close+0x2af/0x980 net/tls/tls_main.c:277 Bluetooth: hci0: command 0x0419 tx timeout Code: 89 ca 48 89 8d 40 ff ff ff 48 c1 ea 03 4a 8d 0c 2a 48 89 8d 68 ff ff ff 48 83 e0 fc 48 8d 78 08 49 89 c6 48 89 fe 48 c1 ee 03 <42> 80 3c 2e 00 0f 85 63 05 00 00 49 8b 76 08 48 8d 7e ff 83 e6 01 page dumped because: PAGE_FLAGS_CHECK_AT_FREE flag(s) set IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready Bluetooth: hci3: command 0x0419 tx timeout wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 Bluetooth: hci5: command 0x0419 tx timeout wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 RSP: 0018:ffff888097cb7ca0 EFLAGS: 00010202 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready bad because of flags: 0x100(slab) RAX: 0000000000000000 RBX: ffff888099215040 RCX: ffffed1012f86dad Modules linked in: kasan: CONFIG_KASAN_INLINE enabled RDX: 1ffffffff1322499 RSI: 0000000000000001 RDI: 0000000000000008 ieee80211 phy11: Selected rate control algorithm 'minstrel_ht' Bluetooth: hci4: command 0x0419 tx timeout