bisecting fixing commit since ef244c3088856cf048c77231653b4c92a7b2213c building syzkaller on b35fad31e9c2d4a970d051deff80ec7cc4c3e459 testing commit ef244c3088856cf048c77231653b4c92a7b2213c with gcc (GCC) 8.1.0 kernel signature: d38ba51312faefd56de44c753de814c0342f9ba5 all runs: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv testing current HEAD dcd888983542055210f5e68f1b1f1f8fe11a369a testing commit dcd888983542055210f5e68f1b1f1f8fe11a369a with gcc (GCC) 8.1.0 kernel signature: e24e20d6546a1460474b50f52352b9abaea5bdd1 all runs: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv revisions tested: 2, total time: 25m6.058498018s (build: 16m45.931652532s, test: 7m26.199199616s) the crash still happens on HEAD commit msg: Linux 4.19.95 crash: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9362db86d4 R13: 00000000004c7fba R14: 00000000004de3e8 R15: 0000000000000006 dccp_parse_options: DCCP(000000005b35d979): Option 32 (len=7) error=9 ================================================================== 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 ffff888083b1a722 by task syz-executor.0/9819 CPU: 1 PID: 9819 Comm: syz-executor.0 Not tainted 4.19.95-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: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:00007f9362db7c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f9362db7c90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000005 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9362db86d4 R13: 00000000004c7fba R14: 00000000004de3e8 R15: 0000000000000006 Allocated by task 9819: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 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 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 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 dccp_v4_rcv+0xbcd/0x1bbd net/dccp/ipv4.c:877 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 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 process_backlog+0x1ca/0x6d0 net/core/dev.c:5870 napi_poll net/core/dev.c:6293 [inline] net_rx_action+0x470/0xe20 net/core/dev.c:6359 __do_softirq+0x260/0x92d kernel/softirq.c:292 Freed by task 9819: 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 __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 skb_release_all+0x3d/0x50 net/core/skbuff.c:631 __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: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 The buggy address belongs to the object at ffff888083b1a280 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1186 bytes inside of 2048-byte region [ffff888083b1a280, ffff888083b1aa80) The buggy address belongs to the page: page:ffffea00020ec680 count:1 mapcount:0 mapping:ffff88812c35ec40 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffffea0001d8f108 ffffea00023bcd88 ffff88812c35ec40 raw: 0000000000000000 ffff888083b1a280 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888083b1a600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888083b1a680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888083b1a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888083b1a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888083b1a800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================