netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: simo.ghannam@gmail.com
To: netdev@vger.kernel.org
Cc: Mohamed Ghannam <simo.ghannam@gmail.com>
Subject: [PATCH] tcp/dccp: CVE-2017-8824: use-after-free in DCCP code
Date: Mon,  4 Dec 2017 21:27:08 +0100	[thread overview]
Message-ID: <5a25afc4.919bdf0a.c917c.b05a@mx.google.com> (raw)

From: Mohamed Ghannam <simo.ghannam@gmail.com>

	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 <simo.ghannam@gmail.com>
---
 net/dccp/proto.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index b68168f..1814584 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;
 
@@ -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) {
-- 
2.7.4

             reply	other threads:[~2017-12-04 20:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 20:27 simo.ghannam [this message]
2017-12-04 20:41 ` [PATCH] tcp/dccp: CVE-2017-8824: use-after-free in DCCP code Eric Dumazet
2017-12-04 20:48   ` Eric Dumazet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5a25afc4.919bdf0a.c917c.b05a@mx.google.com \
    --to=simo.ghannam@gmail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).