]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 15 Feb 2021 07:26:02 +0000 (08:26 +0100)
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>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
net/dccp/minisocks.c

index c5c74a34d139d99fb58dc5cebe4d6a8d72a214ed..317cf9a25c236f2c262a0646de603f4231ddfaac 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;