bisecting fixing commit since ef244c3088856cf048c77231653b4c92a7b2213c building syzkaller on b35fad31e9c2d4a970d051deff80ec7cc4c3e459 testing commit ef244c3088856cf048c77231653b4c92a7b2213c with gcc (GCC) 8.1.0 kernel signature: defc8cc93b7db96432341017a12b1b4805309e7909cb6e48dedc5c65f3e049e9 run #0: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #1: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #2: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #3: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #4: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #5: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #6: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #7: crashed: KASAN: use-after-free in ccid2_hc_tx_packet_recv run #8: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv run #9: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv testing current HEAD 5692097116094a4a7045abcc1dbc172dbdc5657e testing commit 5692097116094a4a7045abcc1dbc172dbdc5657e with gcc (GCC) 8.1.0 kernel signature: 67c59896758236951d6115fd1293aefede2a7540e6da083e19c75537627c2953 all runs: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv revisions tested: 2, total time: 27m15.930810436s (build: 18m25.220281885s, test: 7m30.251113948s) the crash still happens on HEAD commit msg: Linux 4.19.109 crash: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv __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+0x2d4/0x740 mm/slab.c:3623 ================================================================== kmalloc include/linux/slab.h:515 [inline] dccp_feat_entry_new+0x140/0x360 net/dccp/feat.c:467 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 ffff8880889c3622 by task syz-executor.2/9856 dccp_feat_push_confirm+0x26/0x280 net/dccp/feat.c:515 dccp_feat_handle_nn_established net/dccp/feat.c:1344 [inline] dccp_feat_parse_options+0xf99/0x1a20 net/dccp/feat.c:1429 dccp_parse_options+0x840/0xf20 net/dccp/options.c:128 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:2339 release_sock+0x4f/0x180 net/core/sock.c:2855 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:00007fe909456c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fe909456c90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe9094576d4 R13: 00000000004c7fba R14: 00000000004de3e8 R15: 0000000000000006 CPU: 1 PID: 9856 Comm: syz-executor.2 Not tainted 4.19.109-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 dccp_parse_options: DCCP(00000000373ce899): Option 32 (len=7) error=9 __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:2339 release_sock+0x4f/0x180 net/core/sock.c:2855 dccp_sendmsg+0x4f6/0xe20 net/dccp/proto.c:818 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 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:00007fc6f5791c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fc6f5791c90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fc6f57926d4 R13: 00000000004c7fba R14: 00000000004de3e8 R15: 0000000000000006 CPU: 0 PID: 9875 Comm: syz-executor.3 Not tainted 4.19.109-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Allocated by task 9856: Call Trace: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 lib/dump_stack.c:118 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 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0x13 lib/fault-inject.c:149 __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] dccp_send_ack+0xb3/0x340 net/dccp/output.c:580 ccid2_hc_rx_packet_recv+0xf9/0x170 net/dccp/ccids/ccid2.c:779 ccid_hc_rx_packet_recv net/dccp/ccid.h:185 [inline] dccp_deliver_input_to_ccids+0xc5/0x210 net/dccp/input.c:180 dccp_rcv_established+0x49/0x70 net/dccp/input.c:378 __should_failslab+0xba/0xf0 mm/failslab.c:32 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 sk_backlog_rcv include/net/sock.h:946 [inline] __sk_receive_skb+0x2a2/0x9a0 net/core/sock.c:473 should_failslab+0x9/0x14 mm/slab_common.c:1558 dccp_v4_rcv+0xbcd/0x1bbd net/dccp/ipv4.c:877 ip_local_deliver_finish+0x235/0x9f0 net/ipv4/ip_input.c:215 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] kmem_cache_alloc_trace+0x2d4/0x740 mm/slab.c:3623 NF_HOOK include/linux/netfilter.h:289 [inline] ip_local_deliver+0x2f7/0x440 net/ipv4/ip_input.c:256 dst_input include/net/dst.h:453 [inline] ip_rcv_finish+0x166/0x270 net/ipv4/ip_input.c:414 NF_HOOK include/linux/netfilter.h:289 [inline] ip_rcv+0xcb/0x2e0 net/ipv4/ip_input.c:524 __netif_receive_skb_one_core+0xe9/0x170 net/core/dev.c:4947 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:5059 kmalloc include/linux/slab.h:515 [inline] dccp_feat_entry_new+0x140/0x360 net/dccp/feat.c:467 process_backlog+0x1ca/0x6d0 net/core/dev.c:5841 napi_poll net/core/dev.c:6264 [inline] net_rx_action+0x470/0xe20 net/core/dev.c:6330 dccp_feat_push_confirm+0x26/0x280 net/dccp/feat.c:515 __do_softirq+0x260/0x92d kernel/softirq.c:292 dccp_feat_handle_nn_established net/dccp/feat.c:1344 [inline] dccp_feat_parse_options+0xf99/0x1a20 net/dccp/feat.c:1429 Freed by task 9856: 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 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 dccp_parse_options+0x840/0xf20 net/dccp/options.c:128 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 dccp_rcv_established+0x23/0x70 net/dccp/input.c:374 skb_free_head+0x74/0x90 net/core/skbuff.c:554 skb_release_data+0x481/0x6c0 net/core/skbuff.c:574 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 skb_release_all+0x3d/0x50 net/core/skbuff.c:631 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x107/0x360 net/core/sock.c:2339 __kfree_skb net/core/skbuff.c:645 [inline] kfree_skb+0x97/0x270 net/core/skbuff.c:663 release_sock+0x4f/0x180 net/core/sock.c:2855 dccp_v4_do_rcv+0x111/0x160 net/dccp/ipv4.c:691 dccp_sendmsg+0x4f6/0xe20 net/dccp/proto.c:818 sk_backlog_rcv include/net/sock.h:946 [inline] __release_sock+0x107/0x360 net/core/sock.c:2339 release_sock+0x4f/0x180 net/core/sock.c:2855 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 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:798 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880889c3180 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1186 bytes inside of 2048-byte region [ffff8880889c3180, ffff8880889c3980) The buggy address belongs to the page: sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 page:ffffea0002227080 count:1 mapcount:0 mapping:ffff88812c35ec40 index:0x0 compound_mapcount: 0 ___sys_sendmsg+0x28e/0x950 net/socket.c:2115 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea0002607608 ffffea00025b3088 ffff88812c35ec40 raw: 0000000000000000 ffff8880889c2080 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880889c3500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880889c3580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880889c3600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880889c3680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb __sys_sendmmsg+0x160/0x370 net/socket.c:2210 ffff8880889c3700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================