Skip to contentSkip to conversation

tcp/dccp: CVE-2017-8824: use-after-free in DCCP code

PATCH In review [email protected] 2 participants 3 messages Dec 4, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp/dccp: CVE-2017-8824: use-after-free in DCCP code

From: Mohamed Ghannam <[email protected]>

Whenever the sock object is in DCCP_CLOSED state, dccp_disconnect() must free
dccps_hc_tx_ccid and dccps_hc_rx_ccid and set to NULL.

---
 net/dccp/proto.c | 4 ++++
 1 file changed, 4 insertions(+)
net/dccp/proto.c +4 -0
index b68168f..1814584 100644
@@ -259,6 +259,7 @@ int dccp_disconnect(struct sock *sk, int flags)
 {
 	struct inet_connection_sock *icsk = inet_csk(sk);
 	struct inet_sock *inet = inet_sk(sk);
+	struct dccp_sock *dp = dccp_sk(sk);
 	int err = 0;
 	const int old_state = sk->sk_state;
 
@@ -279,6 +280,9 @@ int dccp_disconnect(struct sock *sk, int flags)
 
 	dccp_clear_xmit_timers(sk);
 
+	ccid_hc_rx_delete(dp->dccps_hc_rx_ccid, sk);
+	ccid_hc_tx_delete(dp->dccps_hc_tx_ccid, sk);
+	dp->dccps_hc_rx_ccid = dp->dccps_hc_tx_ccid = NULL;
 	__skb_queue_purge(&sk->sk_receive_queue);
 	__skb_queue_purge(&sk->sk_write_queue);
 	if (sk->sk_send_head != NULL) {
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · On Mon, 2017-12-04 at 21:27 +0100, [email protected] wrote:

From: Mohamed Ghannam <[email protected]>

Whenever the sock object is in DCCP_CLOSED state,
dccp_disconnect() must free
dccps_hc_tx_ccid and dccps_hc_rx_ccid and set to NULL.

---

Small nit : white spaces in changelog where not needed :

Whenever the sock object is in DCCP_CLOSED state, dccp_disconnect() must free dccps_hc_tx_ccid and dccps_hc_rx_ccid and set them to NULL.

Thanks !

#2 lore raw
Quoted 10 lines · Eric Dumazet
Quoted 8 lines · On Mon, 2017-12-04 at 21:27 +0100, [email protected] wrote:

From: Mohamed Ghannam <[email protected]>

Whenever the sock object is in DCCP_CLOSED state,
dccp_disconnect() must free
dccps_hc_tx_ccid and dccps_hc_rx_ccid and set to NULL.

---

Quoted 9 lines

Small nit : white spaces in changelog where not needed :

Whenever the sock object is in DCCP_CLOSED state, dccp_disconnect() must free dccps_hc_tx_ccid and dccps_hc_rx_ccid and set them to NULL.

Thanks !

Also patch title mentions tcp, but this is not a tcp fix, only dccp

[PATCH] dccp: CVE-2017-8824: use-after-free in DCCP code