]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
UBUNTU: SAUCE: dccp: avoid double free of ccid on child socket
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 28 Aug 2020 02:47:47 +0000 (23:47 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 30 Sep 2020 12:51:36 +0000 (09:51 -0300)
When a dccp socket is cloned, the pointers to dccps_hc_rx_ccid and
dccps_hc_tx_ccid are copied. When CCID features are activated on the child
socket, the CCID objects are freed, leaving the parent socket with dangling
pointers.

During cloning, set dccps_hc_rx_ccid and dccps_hc_tx_ccid to NULL so the
parent objects are not freed.

Reported-by: Hadar Manor
CVE-2020-16119
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Juerg Haefliger <juerg.haefliger@canonical.com>
net/dccp/minisocks.c

index 25187528c308a38edef64043231ca01106997010..def85e50f1afb1ef930deeff66cfd09037717a56 100644 (file)
@@ -93,6 +93,8 @@ struct sock *dccp_create_openreq_child(const struct sock *sk,
 
                newdp->dccps_role           = DCCP_ROLE_SERVER;
                newdp->dccps_hc_rx_ackvec   = NULL;
+               newdp->dccps_hc_rx_ccid = NULL;
+               newdp->dccps_hc_tx_ccid = NULL;
                newdp->dccps_service_list   = NULL;
                newdp->dccps_service        = dreq->dreq_service;
                newdp->dccps_timestamp_echo = dreq->dreq_timestamp_echo;