Skip to content

Commit 16eb631

Browse files
Thadeu Lima de Souza Cascardoanthraxx
authored andcommitted
Revert "dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect()"
This reverts commit 2677d20. This fixes an issue that after disconnect, dccps_hc_tx_ccid will still be kept, allowing the socket to be reused as a listener socket, and the cloned socket will free its dccps_hc_tx_ccid, leading to a later use after free, when the listener socket is closed. This addresses CVE-2020-16119. Fixes: 2677d20 (dccp: don't free ccid2_hc_tx_sock struct in dccp_disconnect()) Reported-by: Hadar Manor Signed-off-by: Thadeu Lima de Souza Cascardo <[email protected]> Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
1 parent 3f7f92d commit 16eb631

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/dccp/proto.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,9 @@ int dccp_disconnect(struct sock *sk, int flags)
279279

280280
dccp_clear_xmit_timers(sk);
281281
ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
282+
ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
282283
dp->dccps_hc_rx_ccid = NULL;
284+
dp->dccps_hc_tx_ccid = NULL;
283285

284286
__skb_queue_purge(&sk->sk_receive_queue);
285287
__skb_queue_purge(&sk->sk_write_queue);

0 commit comments

Comments
 (0)