From mboxrd@z Thu Jan 1 00:00:00 1970 From: simo.ghannam@gmail.com Subject: [PATCH] dccp: CVE-2017-8824: use-after-free in DCCP code Date: Mon, 4 Dec 2017 22:02:06 +0100 Message-ID: <5a25b7e1.08a5df0a.997e2.12bf@mx.google.com> Cc: Mohamed Ghannam To: netdev@vger.kernel.org Return-path: Received: from mail-wm0-f68.google.com ([74.125.82.68]:35856 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbdLDVC1 (ORCPT ); Mon, 4 Dec 2017 16:02:27 -0500 Received: by mail-wm0-f68.google.com with SMTP id b76so16820195wmg.1 for ; Mon, 04 Dec 2017 13:02:26 -0800 (PST) Sender: netdev-owner@vger.kernel.org List-ID: From: Mohamed Ghannam 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 --- 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