From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224iSkUDl39bvT4ixg4LKl5Fgmzd+BvHNM/4C0TYr+Mp5VzRZgLGaqHob9bFpkgqKLPOCgLl ARC-Seal: i=1; a=rsa-sha256; t=1517256406; cv=none; d=google.com; s=arc-20160816; b=SdE91iPNz01M6+6chYtOY9XBy1OTAByu/ngYS9HnFy5fLtzSi+L0+bAqs3eOcEXUdQ M7KFQSDdcN2zXZlH2OD341qOjofGjKELWG6K8BO/UH6/taVUG8lPu82kM+HqdzcCzqCK Lt5LOPIXyxnHdC9TAlxOQpV5eDPurjoP5CHp4sTSHZwVhGWCyXrBKUO9ZBaEe0OU0l1K dbMFuPq9PjWPRdK0hJVOXAdNX++D97f0Bg3uoHPLMOQHm8iqhGA76ziaEk4t5VqiGoOf +5KZ0biMVRPZJy6sJMjxEkP9DRhCVMHyhVzCvFh+rQe0LPwpi58ACHsPYCp9Gs/z6lmB UK6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Jpw24ewS+vg/yBc63EAPBV5kk+MwGKaqQUO1n9GNgVY=; b=O6lorBiUQbvvlIdDVTe7t96mTGFR62F2+Lf6cZqykdZoz95BvKKdmdyVE+DEY5ndkZ 9bata4vYtbO8FY5naVOqGCKKeRqUwfW/H3TROzzjBnR3CAW3JWPiW6A4+BIkkyqTVnvk dWB/bVFx8ePsT6/TeBkF2rHAdpi1Rpj9Twzw28C3zN6lsAMHwK6SlnKv8biYou08LfZY Q4Lx2Djs/dtI8TUkn0Nsh24KcfYv9cYVrNnnYv+egZR0zMWuUXLR108pXEgZyZN8mQQw Ca2qPaekVtXmvvjzUyDHHxC+rljfPyIROO2sPlt2HSSUkRxFAB9Kk7DWbN2ZQn9smy69 E+2w== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexey Kodanev , Eric Dumazet , "David S. Miller" Subject: [PATCH 4.14 25/71] dccp: dont restart ccid2_hc_tx_rto_expire() if sk in closed state Date: Mon, 29 Jan 2018 13:56:53 +0100 Message-Id: <20180129123828.957970498@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123827.271171825@linuxfoundation.org> References: <20180129123827.271171825@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590958473784622659?= X-GMAIL-MSGID: =?utf-8?q?1590958653233278287?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexey Kodanev [ Upstream commit dd5684ecae3bd8e44b644f50e2c12c7e57fdfef5 ] ccid2_hc_tx_rto_expire() timer callback always restarts the timer again and can run indefinitely (unless it is stopped outside), and after commit 120e9dabaf55 ("dccp: defer ccid_hc_tx_delete() at dismantle time"), which moved ccid_hc_tx_delete() (also includes sk_stop_timer()) from dccp_destroy_sock() to sk_destruct(), this started to happen quite often. The timer prevents releasing the socket, as a result, sk_destruct() won't be called. Found with LTP/dccp_ipsec tests running on the bonding device, which later couldn't be unloaded after the tests were completed: unregister_netdevice: waiting for bond0 to become free. Usage count = 148 Fixes: 2a91aa396739 ("[DCCP] CCID2: Initial CCID2 (TCP-Like) implementation") Signed-off-by: Alexey Kodanev Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- net/dccp/ccids/ccid2.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c @@ -140,6 +140,9 @@ static void ccid2_hc_tx_rto_expire(unsig ccid2_pr_debug("RTO_EXPIRE\n"); + if (sk->sk_state == DCCP_CLOSED) + goto out; + /* back-off timer */ hc->tx_rto <<= 1; if (hc->tx_rto > DCCP_RTO_MAX)