bisecting fixing commit since a03957ab0fd5d7d03b512a72ab9106a1749f556e building syzkaller on 1bfa09b9672821334a7ed926244ebc39910b84f4 testing commit a03957ab0fd5d7d03b512a72ab9106a1749f556e compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: e5aa2ccf578d238d3861c703c5693afbe51d8ca42c38a91edff88e8df294a4c1 run #0: crashed: general protection fault in flex_array_get run #1: crashed: general protection fault in flex_array_get run #2: crashed: general protection fault in corrupted run #3: crashed: general protection fault in flex_array_get run #4: crashed: general protection fault in flex_array_get run #5: crashed: general protection fault in flex_array_get run #6: crashed: general protection fault in corrupted run #7: crashed: general protection fault in flex_array_get run #8: crashed: general protection fault in flex_array_get run #9: crashed: general protection fault in flex_array_get run #10: crashed: general protection fault in flex_array_get run #11: crashed: general protection fault in flex_array_get run #12: crashed: general protection fault in flex_array_get run #13: crashed: general protection fault in flex_array_get run #14: crashed: general protection fault in flex_array_get run #15: crashed: general protection fault in corrupted run #16: crashed: general protection fault in flex_array_get run #17: crashed: general protection fault in flex_array_get run #18: crashed: general protection fault in flex_array_get run #19: crashed: general protection fault in flex_array_get testing current HEAD 59456c9cc40c8f75b5a7efa0fe1f211d9c6fcaf1 testing commit 59456c9cc40c8f75b5a7efa0fe1f211d9c6fcaf1 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 844340189aaf36828a955a5737b06d6398f674516e79aeef759681ecedccece3 run #0: crashed: general protection fault in flex_array_get run #1: crashed: general protection fault in flex_array_get run #2: crashed: general protection fault in flex_array_get run #3: crashed: general protection fault in flex_array_get run #4: crashed: general protection fault in flex_array_get run #5: crashed: general protection fault in flex_array_get run #6: crashed: general protection fault in flex_array_get run #7: crashed: general protection fault in flex_array_get run #8: crashed: general protection fault in corrupted run #9: crashed: general protection fault in flex_array_get revisions tested: 2, total time: 28m44.754896328s (build: 20m54.349694064s, test: 6m59.739660666s) the crash still happens on HEAD commit msg: Linux 4.19.204 crash: general protection fault in flex_array_get Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 kasan: GPF could be caused by NULL-ptr deref or user memory access Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x171 lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0xa lib/fault-inject.c:149 general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 6803 Comm: syz-executor.4 Not tainted 4.19.204-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 __should_failslab+0xba/0xf0 mm/failslab.c:32 RIP: 0010:flex_array_get+0x23/0x250 lib/flex_array.c:320 should_failslab+0x9/0x20 mm/slab_common.c:1590 Code: 90 90 90 90 90 90 90 48 b8 00 00 00 00 00 fc ff df 55 48 89 fa 48 89 e5 48 c1 ea 03 41 56 41 55 41 54 53 48 89 fb 48 83 ec 10 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 86 01 00 00 44 8b 2b 45 85 ed slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] kmem_cache_alloc_trace+0x4b/0x740 mm/slab.c:3623 RSP: 0018:ffff8881ca59f5a8 EFLAGS: 00010282 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff1103aee2866 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] sctp_association_new+0x5b/0x1ef0 net/sctp/associola.c:313 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff8881ca59f5d8 R08: ffff8881ca59f908 R09: ffffed103ed24732 sctp_make_temp_asoc+0x8b/0x1a0 net/sctp/sm_make_chunk.c:1606 R10: ffffed103ed24732 R11: ffff8881f6923993 R12: ffff8881cc856100 sctp_sf_do_unexpected_init net/sctp/sm_statefuns.c:1554 [inline] sctp_sf_do_unexpected_init.isra.36+0x66c/0x1400 net/sctp/sm_statefuns.c:1466 R13: ffff8881c8d803c4 R14: ffff8881e6720b00 R15: 1ffff1103990ad09 FS: 00007f370d7f1700(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 sctp_sf_do_5_2_1_siminit+0xf/0x20 net/sctp/sm_statefuns.c:1695 CR2: 00007f7344039078 CR3: 00000001d7fbe002 CR4: 00000000001606e0 sctp_do_sm+0x112/0x4e60 net/sctp/sm_sideeffect.c:1167 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: sctp_stream_out include/net/sctp/structs.h:1474 [inline] sctp_sched_dequeue_done+0x1d8/0x300 net/sctp/stream_sched.c:255 __sctp_outq_teardown+0x660/0xc30 net/sctp/outqueue.c:268 sctp_outq_free+0x9/0x10 net/sctp/outqueue.c:292 sctp_association_free+0x1d5/0x720 net/sctp/associola.c:361 sctp_cmd_delete_tcb net/sctp/sm_sideeffect.c:944 [inline] sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1332 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] sctp_do_sm+0x989/0x4e60 net/sctp/sm_sideeffect.c:1170 sctp_assoc_bh_rcv+0x27f/0x5c0 net/sctp/associola.c:1073 sctp_inq_push+0x1aa/0x240 net/sctp/inqueue.c:95 sctp_backlog_rcv+0x1ab/0x13b0 net/sctp/input.c:356 sctp_primitive_SHUTDOWN+0x7c/0xc0 net/sctp/primitive.c:104 sctp_close+0x354/0x750 net/sctp/socket.c:1574 inet_release+0xb9/0x1b0 net/ipv4/af_inet.c:427 sk_backlog_rcv include/net/sock.h:950 [inline] __release_sock+0x10c/0x360 net/core/sock.c:2344 __sock_release+0xc7/0x2a0 net/socket.c:599 release_sock+0x4f/0x180 net/core/sock.c:2881 sock_close+0x10/0x20 net/socket.c:1212 sctp_wait_for_connect+0x22c/0x4c0 net/sctp/socket.c:8635 __fput+0x24c/0x7f0 fs/file_table.c:278 ____fput+0x9/0x10 fs/file_table.c:309 task_work_run+0x10e/0x190 kernel/task_work.c:113 get_signal+0x13ad/0x19e0 kernel/signal.c:2400 do_signal+0x87/0x1960 arch/x86/kernel/signal.c:799 sctp_sendmsg_to_asoc+0x16c5/0x1f70 net/sctp/socket.c:2003 sctp_sendmsg+0xf24/0x1670 net/sctp/socket.c:2149 exit_to_usermode_loop+0x114/0x200 arch/x86/entry/common.c:163 inet_sendmsg+0x10d/0x450 net/ipv4/af_inet.c:798 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline] syscall_return_slowpath arch/x86/entry/common.c:271 [inline] do_syscall_64+0x419/0x4e0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4605f9 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xb7/0xf0 net/socket.c:661 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 ___sys_sendmsg+0x649/0x950 net/socket.c:2225 RSP: 002b:00007f370d7f1198 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: 000000000001fff8 RBX: 000000000052bf00 RCX: 00000000004605f9 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 0000000000000003 R14: 00000000004b178a R15: 00007f370d7f16bc Modules linked in: __sys_sendmsg+0xd9/0x180 net/socket.c:2263 __do_sys_sendmsg net/socket.c:2272 [inline] __se_sys_sendmsg net/socket.c:2270 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2270 do_syscall_64+0xd6/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4605f9 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:00007fb3a46df198 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000052bf00 RCX: 00000000004605f9 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 0000000000000003 R14: 00000000004b178a R15: 00007fb3a46df6bc CPU: 1 PID: 6807 Comm: syz-executor.2 Tainted: G D 4.19.204-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+0x123/0x171 lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0xa lib/fault-inject.c:149 __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_trace+0x5a/0x730 mm/slab.c:3666 __do_kmalloc_node mm/slab.c:3688 [inline] __kmalloc_node_track_caller+0x3c/0x70 mm/slab.c:3703 __kmalloc_reserve.isra.39+0x2c/0xc0 net/core/skbuff.c:137 __alloc_skb+0xd7/0x580 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:995 [inline] _sctp_make_chunk+0x3f/0x260 net/sctp/sm_make_chunk.c:1411 sctp_make_control net/sctp/sm_make_chunk.c:1458 [inline] sctp_make_cookie_echo+0x85/0x160 net/sctp/sm_make_chunk.c:591 sctp_cmd_interpreter net/sctp/sm_sideeffect.c:1397 [inline] sctp_side_effects net/sctp/sm_sideeffect.c:1199 [inline] sctp_do_sm+0x27cb/0x4e60 net/sctp/sm_sideeffect.c:1170 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 sctp_assoc_bh_rcv+0x27f/0x5c0 net/sctp/associola.c:1073 sctp_inq_push+0x1aa/0x240 net/sctp/inqueue.c:95 sctp_backlog_rcv+0x1ab/0x13b0 net/sctp/input.c:356 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 sk_backlog_rcv include/net/sock.h:950 [inline] __release_sock+0x10c/0x360 net/core/sock.c:2344 release_sock+0x4f/0x180 net/core/sock.c:2881 sctp_wait_for_connect+0x22c/0x4c0 net/sctp/socket.c:8635 sctp_sendmsg_to_asoc+0x16c5/0x1f70 net/sctp/socket.c:2003 sctp_sendmsg+0xf24/0x1670 net/sctp/socket.c:2149 inet_sendmsg+0x10d/0x450 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xb7/0xf0 net/socket.c:661 ___sys_sendmsg+0x649/0x950 net/socket.c:2225 __sys_sendmsg+0xd9/0x180 net/socket.c:2263 __do_sys_sendmsg net/socket.c:2272 [inline] __se_sys_sendmsg net/socket.c:2270 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2270 do_syscall_64+0xd6/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4605f9 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:00007fb36635d198 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000052bf00 RCX: 00000000004605f9 RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003 RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000005 R13: 0000000000000003 R14: 00000000004b178a R15: 00007fb36635d6bc CPU: 0 PID: 6812 Comm: syz-executor.3 Tainted: G D 4.19.204-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ---[ end trace fffe6b79a327389d ]--- Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x171 lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0xa lib/fault-inject.c:149 RIP: 0010:flex_array_get+0x23/0x250 lib/flex_array.c:320 Code: 90 90 90 90 90 90 90 48 b8 00 00 00 00 00 fc ff df 55 48 89 fa 48 89 e5 48 c1 ea 03 41 56 41 55 41 54 53 48 89 fb 48 83 ec 10 <0f> b6 04 02 84 c0 74 08 3c 03 0f 8e 86 01 00 00 44 8b 2b 45 85 ed RSP: 0018:ffff8881ca59f5a8 EFLAGS: 00010282 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 1ffff1103aee2866 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff8881ca59f5d8 R08: ffff8881ca59f908 R09: ffffed103ed24732 R10: ffffed103ed24732 R11: ffff8881f6923993 R12: ffff8881cc856100 R13: ffff8881c8d803c4 R14: ffff8881e6720b00 R15: 1ffff1103990ad09 __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 mm/slab.c:3383 [inline] kmem_cache_alloc+0x47/0x730 mm/slab.c:3557 FS: 00007f370d7f1700(0000) GS:ffff8881f6900000(0000) knlGS:0000000000000000 kmem_cache_zalloc include/linux/slab.h:699 [inline] fill_pool lib/debugobjects.c:134 [inline] __debug_object_init+0x7dc/0xd70 lib/debugobjects.c:379 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 debug_object_init+0x16/0x20 lib/debugobjects.c:431 CR2: 00000000004fdb54 CR3: 00000001d7fbe003 CR4: 00000000001606e0 debug_timer_init kernel/time/timer.c:713 [inline] debug_init kernel/time/timer.c:766 [inline] init_timer_key+0x2e/0x270 kernel/time/timer.c:815 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 sctp_association_init net/sctp/associola.c:153 [inline] sctp_association_new+0x9fd/0x1ef0 net/sctp/associola.c:317 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 sctp_make_temp_asoc+0x8b/0x1a0 net/sctp/sm_make_chunk.c:1606 sctp_sf_do_unexpected_init net/sctp/sm_statefuns.c:1554 [inline] sctp_sf_do_unexpected_init.isra.36+0x66c/0x1400 net/sctp/sm_statefuns.c:1466 sctp_sf_do_5_2_1_siminit+0xf/0x20 net/sctp/sm_statefuns.c:1695 sctp_do_sm+0x112/0x4e60 net/sctp/sm_sideeffect.c:1167 ---------------- Code disassembly (best guess): 0: 90 nop 1: 90 nop 2: 90 nop 3: 90 nop 4: 90 nop 5: 90 nop 6: 90 nop 7: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax e: fc ff df 11: 55 push %rbp 12: 48 89 fa mov %rdi,%rdx 15: 48 89 e5 mov %rsp,%rbp 18: 48 c1 ea 03 shr $0x3,%rdx 1c: 41 56 push %r14 1e: 41 55 push %r13 20: 41 54 push %r12 22: 53 push %rbx 23: 48 89 fb mov %rdi,%rbx 26: 48 83 ec 10 sub $0x10,%rsp 2a: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax <-- trapping instruction 2e: 84 c0 test %al,%al 30: 74 08 je 0x3a 32: 3c 03 cmp $0x3,%al 34: 0f 8e 86 01 00 00 jle 0x1c0 3a: 44 8b 2b mov (%rbx),%r13d 3d: 45 85 ed test %r13d,%r13d