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

Subsystems: networking [general], the rest

STALE3242d

3 messages, 3 authors, 2017-12-05 · open the first message on its own page

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

From: <hidden>
Date: 2017-12-05 20:58:49

From: Mohamed Ghannam <redacted>

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.

Signed-off-by: Mohamed Ghannam <redacted>
---
 net/dccp/proto.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index b68168f..9d43c1f 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -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;
 
@@ -278,6 +279,10 @@ int dccp_disconnect(struct sock *sk, int flags)
 		sk->sk_err = ECONNRESET;
 
 	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 = NULL;
+	dp->dccps_hc_tx_ccid = NULL;
 
 	__skb_queue_purge(&sk->sk_receive_queue);
 	__skb_queue_purge(&sk->sk_write_queue);
-- 
2.7.4

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

From: Eric Dumazet <hidden>
Date: 2017-12-05 21:02:40

On Tue, 2017-12-05 at 20:58 +0000, simo.ghannam@gmail.com wrote:
From: Mohamed Ghannam <redacted>

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.

Signed-off-by: Mohamed Ghannam <redacted>
---
Reviewed-by: Eric Dumazet <redacted>

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

From: David Miller <davem@davemloft.net>
Date: 2017-12-05 23:09:14

From: simo.ghannam@gmail.com
Date: Tue,  5 Dec 2017 20:58:35 +0000
From: Mohamed Ghannam <redacted>

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.

Signed-off-by: Mohamed Ghannam <redacted>
Applied and queued up for -stable, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help