================================================================== BUG: KASAN: use-after-free in ccid_hc_tx_delete+0xde/0x100 net/dccp/ccid.c:188 Read of size 8 at addr ffff8880897dec80 by task udevd/7809 CPU: 1 PID: 7809 Comm: udevd Not tainted 5.1.0-rc3-next-20190408 #20 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 ccid_hc_tx_delete+0xde/0x100 net/dccp/ccid.c:188 dccp_sk_destruct+0x3f/0x90 net/dccp/proto.c:181 __sk_destruct+0x55/0x6d0 net/core/sock.c:1699 __rcu_reclaim kernel/rcu/rcu.h:227 [inline] rcu_do_batch kernel/rcu/tree.c:2092 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2310 [inline] rcu_core+0x985/0x1410 kernel/rcu/tree.c:2291 __do_softirq+0x266/0x95a kernel/softirq.c:293 invoke_softirq kernel/softirq.c:374 [inline] irq_exit+0x180/0x1d0 kernel/softirq.c:414 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0x14a/0x570 arch/x86/kernel/apic/apic.c:1062 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 RIP: 0010:arch_local_save_flags arch/x86/include/asm/paravirt.h:762 [inline] RIP: 0010:arch_local_irq_save arch/x86/include/asm/paravirt.h:784 [inline] RIP: 0010:lock_acquire+0x93/0x3f0 kernel/locking/lockdep.c:4206 Code: 01 00 00 48 c7 c0 68 9b 92 88 48 ba 00 00 00 00 00 fc ff df 48 c1 e8 03 80 3c 10 00 0f 85 f9 02 00 00 48 83 3d 55 0e 3b 07 00 <0f> 84 82 02 00 00 9c 58 0f 1f 44 00 00 48 ba 00 00 00 00 00 fc ff RSP: 0018:ffff88809879f8c0 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff13 RAX: 1ffffffff112536d RBX: ffff888085fe4280 RCX: 0000000000000000 RDX: dffffc0000000000 RSI: 0000000000000000 RDI: ffff888085fe4afc RBP: ffff88809879f908 R08: 0000000000000001 R09: 0000000000000000 R10: ffff888085fe4b28 R11: 0000000000000001 R12: ffff8880a31d7af8 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 down_write+0x38/0x90 kernel/locking/rwsem.c:70 i_mmap_lock_write include/linux/fs.h:516 [inline] unlink_file_vma+0x76/0xb0 mm/mmap.c:167 free_pgtables+0x1b7/0x2f0 mm/memory.c:395 exit_mmap+0x2d1/0x530 mm/mmap.c:3144 __mmput kernel/fork.c:1056 [inline] mmput+0x15f/0x4c0 kernel/fork.c:1077 exec_mmap fs/exec.c:1046 [inline] flush_old_exec+0x8d9/0x1c20 fs/exec.c:1279 load_elf_binary+0x9dd/0x5240 fs/binfmt_elf.c:870 search_binary_handler fs/exec.c:1656 [inline] search_binary_handler+0x17f/0x570 fs/exec.c:1634 exec_binprm fs/exec.c:1698 [inline] __do_execve_file.isra.0+0x1394/0x23f0 fs/exec.c:1818 do_execveat_common fs/exec.c:1865 [inline] do_execve fs/exec.c:1882 [inline] __do_sys_execve fs/exec.c:1958 [inline] __se_sys_execve fs/exec.c:1953 [inline] __x64_sys_execve+0x8f/0xc0 fs/exec.c:1953 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fd5bc6ec207 Code: Bad RIP value. RSP: 002b:00007fffcbfc08f8 EFLAGS: 00000202 ORIG_RAX: 000000000000003b RAX: ffffffffffffffda RBX: 00000000ffffffff RCX: 00007fd5bc6ec207 RDX: 0000000001ee98a0 RSI: 00007fffcbfc09f0 RDI: 00007fffcbfc1a00 RBP: 0000000000625500 R08: 0000000000001cab R09: 0000000000001cab R10: 0000000000000000 R11: 0000000000000202 R12: 0000000001ee98a0 R13: 0000000000000007 R14: 0000000001ed1250 R15: 0000000000000005 Allocated by task 7787: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_slab_alloc+0xf/0x20 mm/kasan/common.c:505 slab_post_alloc_hook mm/slab.h:437 [inline] slab_alloc mm/slab.c:3392 [inline] kmem_cache_alloc+0x11a/0x6f0 mm/slab.c:3554 ccid_new+0x256/0x3f0 net/dccp/ccid.c:151 dccp_hdlr_ccid+0x27/0x150 net/dccp/feat.c:44 __dccp_feat_activate+0x17a/0x270 net/dccp/feat.c:344 dccp_feat_activate_values+0x33a/0x766 net/dccp/feat.c:1543 dccp_rcv_request_sent_state_process net/dccp/input.c:472 [inline] dccp_rcv_state_process+0x116f/0x1935 net/dccp/input.c:680 dccp_v6_do_rcv+0x269/0xbf0 net/dccp/ipv6.c:641 sk_backlog_rcv include/net/sock.h:945 [inline] __release_sock+0x12e/0x3a0 net/core/sock.c:2413 release_sock+0x59/0x1c0 net/core/sock.c:2929 inet_wait_for_connect net/ipv4/af_inet.c:592 [inline] __inet_stream_connect+0x59f/0xea0 net/ipv4/af_inet.c:684 inet_stream_connect+0x58/0xa0 net/ipv4/af_inet.c:723 __sys_connect+0x266/0x330 net/socket.c:1808 __do_sys_connect net/socket.c:1819 [inline] __se_sys_connect net/socket.c:1816 [inline] __x64_sys_connect+0x73/0xb0 net/socket.c:1816 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7800: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3498 [inline] kmem_cache_free+0x86/0x260 mm/slab.c:3764 ccid_hc_tx_delete+0xc1/0x100 net/dccp/ccid.c:190 dccp_hdlr_ccid+0x7d/0x150 net/dccp/feat.c:53 __dccp_feat_activate+0x17a/0x270 net/dccp/feat.c:344 dccp_feat_activate_values+0x33a/0x766 net/dccp/feat.c:1543 dccp_create_openreq_child+0x40c/0x570 net/dccp/minisocks.c:127 dccp_v6_request_recv_sock+0x214/0x1e80 net/dccp/ipv6.c:469 dccp_check_req+0x35c/0x6f0 net/dccp/minisocks.c:196 dccp_v6_rcv+0x6d7/0x191e net/dccp/ipv6.c:747 ip6_protocol_deliver_rcu+0x303/0x16c0 net/ipv6/ip6_input.c:394 ip6_input_finish+0x84/0x170 net/ipv6/ip6_input.c:434 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ip6_input+0xe4/0x3f0 net/ipv6/ip6_input.c:443 dst_input include/net/dst.h:439 [inline] ip6_rcv_finish+0x1e7/0x320 net/ipv6/ip6_input.c:76 NF_HOOK include/linux/netfilter.h:289 [inline] NF_HOOK include/linux/netfilter.h:283 [inline] ipv6_rcv+0x10e/0x420 net/ipv6/ip6_input.c:272 __netif_receive_skb_one_core+0x115/0x1a0 net/core/dev.c:4976 __netif_receive_skb+0x2c/0x1d0 net/core/dev.c:5088 process_backlog+0x206/0x750 net/core/dev.c:5928 napi_poll net/core/dev.c:6351 [inline] net_rx_action+0x4fa/0x1070 net/core/dev.c:6417 __do_softirq+0x266/0x95a kernel/softirq.c:293 The buggy address belongs to the object at ffff8880897dec80 which belongs to the cache ccid2_hc_tx_sock of size 1240 The buggy address is located 0 bytes inside of 1240-byte region [ffff8880897dec80, ffff8880897df158) The buggy address belongs to the page: page:ffffea000225f780 count:1 mapcount:0 mapping:ffff8882166a4940 index:0x0 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea00022ca588 ffffea00022d3788 ffff8882166a4940 raw: 0000000000000000 ffff8880897de180 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880897deb80: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc ffff8880897dec00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880897dec80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880897ded00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880897ded80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================