bisecting fixing commit since ef244c3088856cf048c77231653b4c92a7b2213c building syzkaller on b35fad31e9c2d4a970d051deff80ec7cc4c3e459 testing commit ef244c3088856cf048c77231653b4c92a7b2213c with gcc (GCC) 8.1.0 kernel signature: 0b8b5a4043a9180dc66663efcc48128b3664a1ebb8c41e53af5b2ceaedf9a2d0 all runs: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv testing current HEAD dda0e2920330128e0dbdeb11c8f25031aa40b11c testing commit dda0e2920330128e0dbdeb11c8f25031aa40b11c with gcc (GCC) 8.1.0 kernel signature: 8278e97dd0ee141ae3296a7f2608d496dd7e180ccee12cdb5be61fcc781f6137 all runs: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv revisions tested: 2, total time: 24m29.816427806s (build: 17m30.366578123s, test: 5m56.615974003s) the crash still happens on HEAD commit msg: Linux 4.19.114 crash: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0x13 lib/fault-inject.c:149 ================================================================== __should_failslab+0xba/0xf0 mm/failslab.c:32 BUG: KASAN: use-after-free in ccid2_hc_tx_packet_recv+0x1edd/0x21d3 net/dccp/ccids/ccid2.c:600 Read of size 1 at addr ffff888091ad0522 by task syz-executor.5/7294 should_failslab+0x9/0x14 mm/slab_common.c:1558 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 kmalloc include/linux/slab.h:515 [inline] dccp_ackvec_parsed_add+0x51/0x220 net/dccp/ackvec.c:352 ccid2_hc_tx_parse_options+0x5b/0x80 net/dccp/ccids/ccid2.c:513 ccid_hc_tx_parse_options net/dccp/ccid.h:207 [inline] dccp_parse_options+0x532/0xf20 net/dccp/options.c:233 dccp_rcv_established+0x23/0x70 net/dccp/input.c:374 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x107/0x360 net/core/sock.c:2342 release_sock+0x4f/0x180 net/core/sock.c:2858 dccp_sendmsg+0x4f6/0xe20 net/dccp/proto.c:818 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 ___sys_sendmsg+0x28e/0x950 net/socket.c:2115 __sys_sendmmsg+0x160/0x370 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x98/0x100 net/socket.c:2236 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a219 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f0b1192fc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f0b1192fc90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f0b119306d4 R13: 00000000004c7fba R14: 00000000004de3e8 R15: 0000000000000006 CPU: 0 PID: 7294 Comm: syz-executor.5 Not tainted 4.19.114-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/0x177 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430 ccid2_hc_tx_packet_recv+0x1edd/0x21d3 net/dccp/ccids/ccid2.c:600 ccid_hc_tx_packet_recv net/dccp/ccid.h:192 [inline] dccp_deliver_input_to_ccids+0x19f/0x210 net/dccp/input.c:186 dccp_rcv_established+0x49/0x70 net/dccp/input.c:378 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x107/0x360 net/core/sock.c:2342 release_sock+0x4f/0x180 net/core/sock.c:2858 dccp_sendmsg+0x4f6/0xe20 net/dccp/proto.c:818 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 ___sys_sendmsg+0x28e/0x950 net/socket.c:2115 dccp_parse_options: DCCP(00000000433cb479): Option 38 (len=1) error=5 __sys_sendmmsg+0x160/0x370 net/socket.c:2210 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x98/0x100 net/socket.c:2236 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a219 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ff56a948c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007ff56a948c90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff56a9496d4 R13: 00000000004c7fba R14: 00000000004de3e8 R15: 0000000000000006 CPU: 1 PID: 7316 Comm: syz-executor.1 Not tainted 4.19.114-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Allocated by task 7294: Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 lib/dump_stack.c:118 save_stack+0x43/0xd0 mm/kasan/kasan.c:448 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0x13 lib/fault-inject.c:149 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node_track_caller+0x50/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 __should_failslab+0xba/0xf0 mm/failslab.c:32 alloc_skb include/linux/skbuff.h:995 [inline] dccp_send_ack+0xb3/0x340 net/dccp/output.c:580 ccid2_hc_rx_packet_recv+0xf9/0x170 net/dccp/ccids/ccid2.c:779 should_failslab+0x9/0x14 mm/slab_common.c:1558 ccid_hc_rx_packet_recv net/dccp/ccid.h:185 [inline] dccp_deliver_input_to_ccids+0xc5/0x210 net/dccp/input.c:180 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 dccp_rcv_established+0x49/0x70 net/dccp/input.c:378 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 kmalloc include/linux/slab.h:515 [inline] dccp_ackvec_parsed_add+0x51/0x220 net/dccp/ackvec.c:352 sk_backlog_rcv include/net/sock.h:946 [inline] __sk_receive_skb+0x2a2/0x9a0 net/core/sock.c:473 dccp_v4_rcv+0xbcd/0x1bbd net/dccp/ipv4.c:877 ccid2_hc_tx_parse_options+0x5b/0x80 net/dccp/ccids/ccid2.c:513 ip_local_deliver_finish+0x235/0x9f0 net/ipv4/ip_input.c:215 NF_HOOK include/linux/netfilter.h:289 [inline] ip_local_deliver+0x2f7/0x440 net/ipv4/ip_input.c:256 ccid_hc_tx_parse_options net/dccp/ccid.h:207 [inline] dccp_parse_options+0x532/0xf20 net/dccp/options.c:233 dst_input include/net/dst.h:453 [inline] ip_rcv_finish+0x166/0x270 net/ipv4/ip_input.c:414 dccp_rcv_established+0x23/0x70 net/dccp/input.c:374 NF_HOOK include/linux/netfilter.h:289 [inline] ip_rcv+0xcb/0x2e0 net/ipv4/ip_input.c:524 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 __netif_receive_skb_one_core+0xe9/0x170 net/core/dev.c:4947 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:5059 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x107/0x360 net/core/sock.c:2342 process_backlog+0x1ca/0x6d0 net/core/dev.c:5841 release_sock+0x4f/0x180 net/core/sock.c:2858 napi_poll net/core/dev.c:6264 [inline] net_rx_action+0x470/0xe20 net/core/dev.c:6330 __do_softirq+0x260/0x92d kernel/softirq.c:292 dccp_sendmsg+0x4f6/0xe20 net/dccp/proto.c:818 Freed by task 7294: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 skb_free_head+0x74/0x90 net/core/skbuff.c:554 skb_release_data+0x481/0x6c0 net/core/skbuff.c:574 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 skb_release_all+0x3d/0x50 net/core/skbuff.c:631 ___sys_sendmsg+0x28e/0x950 net/socket.c:2115 __kfree_skb net/core/skbuff.c:645 [inline] kfree_skb+0x97/0x270 net/core/skbuff.c:663 dccp_v4_do_rcv+0x111/0x160 net/dccp/ipv4.c:691 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x107/0x360 net/core/sock.c:2342 release_sock+0x4f/0x180 net/core/sock.c:2858 dccp_sendmsg+0x4f6/0xe20 net/dccp/proto.c:818 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 ___sys_sendmsg+0x28e/0x950 net/socket.c:2115 __sys_sendmmsg+0x160/0x370 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x98/0x100 net/socket.c:2236 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe __sys_sendmmsg+0x160/0x370 net/socket.c:2210 The buggy address belongs to the object at ffff888091ad0080 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1186 bytes inside of 2048-byte region [ffff888091ad0080, ffff888091ad0880) The buggy address belongs to the page: page:ffffea000246b400 count:1 mapcount:0 mapping:ffff88812c35ec40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea0002532a88 ffffea000246b508 ffff88812c35ec40 raw: 0000000000000000 ffff888091ad0080 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888091ad0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888091ad0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888091ad0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888091ad0580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x98/0x100 net/socket.c:2236 ffff888091ad0600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 ================================================================== entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a219 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007ff1d5a2ec78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007ff1d5a2ec90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000005 RBP: 000000000075bfc8 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff1d5a2f6d4 R13: 00000000004c7fba R14: 00000000004de3e8 R15: 0000000000000006 CPU: 0 PID: 7313 Comm: syz-executor.4 Tainted: G B 4.19.114-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/0x177 lib/dump_stack.c:118 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0x13 lib/fault-inject.c:149 __should_failslab+0xba/0xf0 mm/failslab.c:32 should_failslab+0x9/0x14 mm/slab_common.c:1558 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 kmalloc include/linux/slab.h:515 [inline] dccp_ackvec_parsed_add+0x51/0x220 net/dccp/ackvec.c:352 ccid2_hc_tx_parse_options+0x5b/0x80 net/dccp/ccids/ccid2.c:513 ccid_hc_tx_parse_options net/dccp/ccid.h:207 [inline] dccp_parse_options+0x532/0xf20 net/dccp/options.c:233 dccp_rcv_established+0x23/0x70 net/dccp/input.c:374 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x107/0x360 net/core/sock.c:2342 release_sock+0x4f/0x180 net/core/sock.c:2858 dccp_sendmsg+0x4f6/0xe20 net/dccp/proto.c:818 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 ___sys_sendmsg+0x28e/0x950 net/socket.c:2115