syzbot


KASAN: use-after-free Read in ccid_hc_rx_delete

Status: closed as invalid on 2018/02/13 18:45
Subsystems: dccp
[Documentation on labels]
Reported-by: syzbot+0fdeffe881a0fafd22203b4daabeaec9bac015c3@syzkaller.appspotmail.com
First crash: 2725d, last: 2725d

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in ccid_hc_rx_delete+0xd5/0x100 net/dccp/ccid.c:179
Read of size 8 at addr ffff8801c16c21e0 by task syz-executor7/4888

CPU: 0 PID: 4888 Comm: syz-executor7 Not tainted 4.14.0-rc2-next-20170928+ #31
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x194/0x257 lib/dump_stack.c:52
 print_address_description+0x73/0x250 mm/kasan/report.c:252
 kasan_report_error mm/kasan/report.c:351 [inline]
 kasan_report+0x25b/0x340 mm/kasan/report.c:409
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430
 ccid_hc_rx_delete+0xd5/0x100 net/dccp/ccid.c:179
 dccp_destroy_sock+0x2c6/0x3f0 net/dccp/proto.c:232
 dccp_v6_destroy_sock+0x15/0x20 net/dccp/ipv6.c:1017
 inet_csk_destroy_sock+0x166/0x3f0 net/ipv4/inet_connection_sock.c:835
 dccp_close+0x84d/0xc10 net/dccp/proto.c:1074
 inet_release+0xed/0x1c0 net/ipv4/af_inet.c:425
 inet6_release+0x50/0x70 net/ipv6/af_inet6.c:433
 sock_release+0x8d/0x1e0 net/socket.c:597
 sock_close+0x16/0x20 net/socket.c:1126
 __fput+0x333/0x7f0 fs/file_table.c:210
 ____fput+0x15/0x20 fs/file_table.c:244
 task_work_run+0x199/0x270 kernel/task_work.c:112
 exit_task_work include/linux/task_work.h:21 [inline]
 do_exit+0x9c8/0x1b00 kernel/exit.c:865
 do_group_exit+0x149/0x400 kernel/exit.c:968
 get_signal+0x73f/0x16d0 kernel/signal.c:2334
 do_signal+0x94/0x1ee0 arch/x86/kernel/signal.c:808
 exit_to_usermode_loop+0x214/0x310 arch/x86/entry/common.c:158
 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:266 [inline]
 do_syscall_64+0x65c/0x8d0 arch/x86/entry/common.c:292
 entry_SYSCALL64_slow_path+0x25/0x25
RIP: 0033:0x4520a9
RSP: 002b:00007f8c9c05fcf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 0000000000718238 RCX: 00000000004520a9
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000718238
RBP: 0000000000718210 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000a6f7ef R14: 00007f8c9c0609c0 R15: 0000000000000004

Allocated by task 4864:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 save_stack+0x43/0xd0 mm/kasan/kasan.c:447
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:551
 kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489
 kmem_cache_alloc+0x12e/0x760 mm/slab.c:3562
 ccid_new+0x10a/0x390 net/dccp/ccid.c:151
 dccp_hdlr_ccid+0x27/0x140 net/dccp/feat.c:44
 __dccp_feat_activate+0x142/0x2a0 net/dccp/feat.c:344
 dccp_feat_activate_values+0x313/0xa90 net/dccp/feat.c:1537
 dccp_rcv_request_sent_state_process net/dccp/input.c:472 [inline]
 dccp_rcv_state_process+0xed1/0x1620 net/dccp/input.c:677
 dccp_v6_do_rcv+0x213/0x9b0 net/dccp/ipv6.c:637
 sk_backlog_rcv include/net/sock.h:909 [inline]
 __release_sock+0x124/0x360 net/core/sock.c:2259
 release_sock+0xa4/0x2a0 net/core/sock.c:2771
 inet_wait_for_connect net/ipv4/af_inet.c:557 [inline]
 __inet_stream_connect+0x651/0xf00 net/ipv4/af_inet.c:643
 inet_stream_connect+0x58/0xa0 net/ipv4/af_inet.c:682
 SYSC_connect+0x20a/0x480 net/socket.c:1642
 SyS_connect+0x24/0x30 net/socket.c:1623
 entry_SYSCALL_64_fastpath+0x1f/0xbe

Freed by task 4870:
 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59
 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:3504 [inline]
 kmem_cache_free+0x77/0x280 mm/slab.c:3764
 ccid_hc_rx_delete+0xbf/0x100 net/dccp/ccid.c:181
 dccp_hdlr_ccid+0xd3/0x140 net/dccp/feat.c:50
 __dccp_feat_activate+0x142/0x2a0 net/dccp/feat.c:344
 dccp_feat_activate_values+0x313/0xa90 net/dccp/feat.c:1537
 dccp_create_openreq_child+0x474/0x600 net/dccp/minisocks.c:121
 dccp_v6_request_recv_sock+0x238/0x1c30 net/dccp/ipv6.c:465
 dccp_check_req+0x321/0x5a0 net/dccp/minisocks.c:190
 dccp_v6_rcv+0x630/0x1bd0 net/dccp/ipv6.c:743
 ip6_input_finish+0x36f/0x16d0 net/ipv6/ip6_input.c:284
 NF_HOOK include/linux/netfilter.h:249 [inline]
 ip6_input+0xe9/0x560 net/ipv6/ip6_input.c:327
 dst_input include/net/dst.h:464 [inline]
 ip6_rcv_finish+0x1a9/0x7a0 net/ipv6/ip6_input.c:71
 NF_HOOK include/linux/netfilter.h:249 [inline]
 ipv6_rcv+0xff0/0x2190 net/ipv6/ip6_input.c:208
 __netif_receive_skb_core+0x19af/0x33d0 net/core/dev.c:4448
 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4486
 process_backlog+0x203/0x740 net/core/dev.c:5165
 napi_poll net/core/dev.c:5563 [inline]
 net_rx_action+0x792/0x1910 net/core/dev.c:5629
 __do_softirq+0x29d/0xbb2 kernel/softirq.c:284

The buggy address belongs to the object at ffff8801c16c21e0
 which belongs to the cache ccid2_hc_rx_sock of size 12
The buggy address is located 0 bytes inside of
 12-byte region [ffff8801c16c21e0, ffff8801c16c21ec)
The buggy address belongs to the page:
page:ffffea000705b080 count:1 mapcount:0 mapping:ffff8801c16c2000 index:0xffff8801c16c2f84
flags: 0x200000000000100(slab)
raw: 0200000000000100 ffff8801c16c2000 ffff8801c16c2f84 0000000100000010
raw: ffff8801d2ad5340 ffff8801d2ad5340 ffff8801d2ad4240 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801c16c2080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801c16c2100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8801c16c2180: fb fb fc fc fb fb fc fc fb fb fc fc fb fb fc fc
                                                       ^
 ffff8801c16c2200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff8801c16c2280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2017/09/28 16:03 linux-next 00d47fc93ae9 c26ea367 .config console log report ci-upstream-next-kasan-gce
* Struck through repros no longer work on HEAD.