bisecting fixing commit since c9fda4f22428e09728b611ec9100157199039bfe building syzkaller on 1e35461e020a8b43c7b2d79ee64eb4068a9f0481 testing commit c9fda4f22428e09728b611ec9100157199039bfe with gcc (GCC) 8.1.0 kernel signature: e91582006063ed83072881046a9019db01e4d7b7498e539644dcc332791edf30 all runs: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv testing current HEAD 78d697fc93f98054e36a3ab76dca1a88802ba7be testing commit 78d697fc93f98054e36a3ab76dca1a88802ba7be with gcc (GCC) 8.1.0 kernel signature: 0ce3c4d681ebc8ed301939c8d28e1dfe14cc82fd0406ca98e3df526a7febde72 all runs: crashed: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv revisions tested: 2, total time: 24m42.351467816s (build: 16m32.457092129s, test: 7m22.508226514s) the crash still happens on HEAD commit msg: Linux 4.14.172 crash: KASAN: use-after-free Read in ccid2_hc_tx_packet_recv should_failslab+0xba/0xf0 mm/failslab.c:32 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3376 [inline] kmem_cache_alloc_trace+0x2ea/0x7a0 mm/slab.c:3616 ================================================================== kmalloc include/linux/slab.h:488 [inline] dccp_feat_entry_new+0x140/0x360 net/dccp/feat.c:467 dccp_feat_push_confirm+0x26/0x280 net/dccp/feat.c:515 BUG: KASAN: use-after-free in ccid2_hc_tx_packet_recv+0x1edd/0x21d3 net/dccp/ccids/ccid2.c:599 Read of size 1 at addr ffff8880a81ed65d by task syz-executor.3/8787 dccp_feat_handle_nn_established net/dccp/feat.c:1344 [inline] dccp_feat_parse_options+0xfe3/0x1a10 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:917 [inline] __release_sock+0x10b/0x340 net/core/sock.c:2264 release_sock+0x4f/0x180 net/core/sock.c:2779 dccp_sendmsg+0x4ab/0xc70 net/dccp/proto.c:813 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 ___sys_sendmsg+0x282/0x920 net/socket.c:2062 __sys_sendmmsg+0x126/0x300 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0xd/0x20 net/socket.c:2178 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45a219 RSP: 002b:00007f560344ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f560344ac90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000006 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f560344b6d4 R13: 00000000004c7f9d R14: 00000000004de3c8 R15: 0000000000000007 CPU: 1 PID: 8787 Comm: syz-executor.3 Not tainted 4.14.172-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:427 ccid2_hc_tx_packet_recv+0x1edd/0x21d3 net/dccp/ccids/ccid2.c:599 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:917 [inline] __release_sock+0x10b/0x340 net/core/sock.c:2264 release_sock+0x4f/0x180 net/core/sock.c:2779 dccp_sendmsg+0x4ab/0xc70 net/dccp/proto.c:813 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 ___sys_sendmsg+0x282/0x920 net/socket.c:2062 __sys_sendmmsg+0x126/0x300 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0xd/0x20 net/socket.c:2178 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45a219 RSP: 002b:00007fcdbe813c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fcdbe813c90 RCX: 000000000045a219 RDX: 04000000000001e6 RSI: 0000000020000c00 RDI: 0000000000000006 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fcdbe8146d4 R13: 00000000004c7f9d R14: 00000000004de3c8 R15: 0000000000000007 CPU: 0 PID: 8792 Comm: syz-executor.1 Not tainted 4.14.172-syzkaller #0 Allocated by task 8787: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 Call Trace: set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node_track_caller+0x50/0x70 mm/slab.c:3696 __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 __kmalloc_reserve.isra.36+0x2c/0xc0 net/core/skbuff.c:137 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.3+0x105/0x14b lib/fault-inject.c:149 __alloc_skb+0xc1/0x500 net/core/skbuff.c:205 should_failslab+0xba/0xf0 mm/failslab.c:32 alloc_skb include/linux/skbuff.h:980 [inline] dccp_send_ack+0xb3/0x340 net/dccp/output.c:580 slab_pre_alloc_hook mm/slab.h:421 [inline] slab_alloc mm/slab.c:3376 [inline] kmem_cache_alloc_trace+0x2ea/0x7a0 mm/slab.c:3616 ccid2_hc_rx_packet_recv+0xf9/0x170 net/dccp/ccids/ccid2.c:778 ccid_hc_rx_packet_recv net/dccp/ccid.h:185 [inline] dccp_deliver_input_to_ccids+0xc5/0x210 net/dccp/input.c:180 kmalloc include/linux/slab.h:488 [inline] dccp_feat_entry_new+0x140/0x360 net/dccp/feat.c:467 dccp_rcv_established+0x49/0x70 net/dccp/input.c:378 dccp_feat_push_confirm+0x26/0x280 net/dccp/feat.c:515 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 sk_backlog_rcv include/net/sock.h:917 [inline] __sk_receive_skb+0x1d5/0x820 net/core/sock.c:511 dccp_feat_handle_nn_established net/dccp/feat.c:1344 [inline] dccp_feat_parse_options+0xfe3/0x1a10 net/dccp/feat.c:1429 dccp_v4_rcv+0xc26/0x1bbf net/dccp/ipv4.c:877 ip_local_deliver_finish+0x230/0x9a0 net/ipv4/ip_input.c:216 NF_HOOK include/linux/netfilter.h:250 [inline] ip_local_deliver+0x1a0/0x410 net/ipv4/ip_input.c:257 dst_input include/net/dst.h:468 [inline] ip_rcv_finish+0x70d/0x1950 net/ipv4/ip_input.c:396 NF_HOOK include/linux/netfilter.h:250 [inline] ip_rcv+0xb43/0x133d net/ipv4/ip_input.c:493 __netif_receive_skb_core+0x1d1a/0x2e40 net/core/dev.c:4477 __netif_receive_skb+0x1f/0x1b0 net/core/dev.c:4515 process_backlog+0x1fc/0x710 net/core/dev.c:5197 dccp_parse_options+0x840/0xf20 net/dccp/options.c:128 napi_poll net/core/dev.c:5598 [inline] net_rx_action+0x458/0xed0 net/core/dev.c:5664 dccp_rcv_established+0x23/0x70 net/dccp/input.c:374 __do_softirq+0x246/0x9b0 kernel/softirq.c:288 dccp_v4_do_rcv+0xfa/0x160 net/dccp/ipv4.c:656 sk_backlog_rcv include/net/sock.h:917 [inline] __release_sock+0x10b/0x340 net/core/sock.c:2264 Freed by task 8787: release_sock+0x4f/0x180 net/core/sock.c:2779 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 dccp_sendmsg+0x4ab/0xc70 net/dccp/proto.c:813 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 skb_free_head+0x74/0x90 net/core/skbuff.c:554 skb_release_data+0x43b/0x790 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+0x8a/0x2b0 net/core/skbuff.c:663 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:762 dccp_v4_do_rcv+0x111/0x160 net/dccp/ipv4.c:691 sk_backlog_rcv include/net/sock.h:917 [inline] __release_sock+0x10b/0x340 net/core/sock.c:2264 release_sock+0x4f/0x180 net/core/sock.c:2779 dccp_sendmsg+0x4ab/0xc70 net/dccp/proto.c:813 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 inet_sendmsg+0x108/0x440 net/ipv4/af_inet.c:762 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 ___sys_sendmsg+0x282/0x920 net/socket.c:2062 ___sys_sendmsg+0x282/0x920 net/socket.c:2062 __sys_sendmmsg+0x126/0x300 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0xd/0x20 net/socket.c:2178 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880a81ed1c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1181 bytes inside of 2048-byte region [ffff8880a81ed1c0, ffff8880a81ed9c0) The buggy address belongs to the page: page:ffffea0002a07b00 count:1 mapcount:0 mapping:ffff8880a81ec0c0 index:0x0 compound_mapcount: 0 __sys_sendmmsg+0x126/0x300 net/socket.c:2152 flags: 0x1fffc0000008100(slab|head) raw: 01fffc0000008100 ffff8880a81ec0c0 0000000000000000 0000000100000003 raw: ffffea00028667a0 ffffea0002844a20 ffff8880aa800c40 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a81ed500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a81ed580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0xd/0x20 net/socket.c:2178 >ffff8880a81ed600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 ^ ffff8880a81ed680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a81ed700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================