Received: by 10.223.176.5 with SMTP id f5csp3351542wra; Mon, 29 Jan 2018 12:05:13 -0800 (PST) X-Google-Smtp-Source: AH8x225wIph62o32HdaVHnmewGwtp3PEkSUT30FBqquoKuBNvXh1atC9z6+vnEHM0yA742t1M+in X-Received: by 2002:a17:902:d688:: with SMTP id v8-v6mr23023064ply.302.1517256313561; Mon, 29 Jan 2018 12:05:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517256313; cv=none; d=google.com; s=arc-20160816; b=thzR0Tgt/owKPpQ3R4CTijMPV/kmN1UjjDzKQdaW4xJODY/4BkVWBpKKgQYeNAVTTJ Fqm63qKrOu5Hkm4FiM8bSQF6s/QnVM+DSM12wE+Du0RHzIjHr3PUgLAESFlQBNXUMh1U kgtYEM7Sx09wBrHiufZQKwaXUZN7H0fj30pEe1vjUJISU3ZB6NYk40XuuIsfyRCjV2Cq UEenqdbsHkOOEYiKyu1MAZFJq41FztiTLBReofBLljLJI4q+Gj3jFxKHjwY23FGrWunX FZdOq8bWmttxr4V3xE1oWa0UP0GJzuXI7iVf/niRRT5EXodhnPywF08egoHCWE/ax4AP Fr8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=XFG5mQovF9nVFKDhagNEV4Fju9WOt91ZNc1lbTwORxM=; b=AOi8/qcFSdlP48i3dH0Me4VSi79sCRCx8pQyYsWrLeNJprn/2E8zEjJxuB5LocNpwk pg2JMTf3LIFFgapB3N0GaCQTZpvjdB01hfKBhWJ+ciFwNNFfjJE0mMcfF9sq0fUFH6mI 5zVEFs1YhlK0T+HczBr+/MZisFstbAeVibxwJq29T/B/ytXI6PKwMzIB1wsMVG3ia+7t 0dCAzqA+lxOxHvERCPo2kU8qeXS1U3fsFTI6O+aUTB9bQwYXm1KSPrbX0L1FpE4csTq8 8exILyFFzFBhtBAtXnzFwoamXSVkMIF4YMIQpR0rZ5YdUUTsXp3j9Q1Jw9ZZar/3UH4+ xMaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si9370490plb.680.2018.01.29.12.04.58; Mon, 29 Jan 2018 12:05:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117AbeA2UDz (ORCPT + 99 others); Mon, 29 Jan 2018 15:03:55 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:41024 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751604AbeA2UDx (ORCPT ); Mon, 29 Jan 2018 15:03:53 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8224C2F53; Mon, 29 Jan 2018 13:04:08 +0000 (UTC) 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.4 58/74] dccp: dont restart ccid2_hc_tx_rto_expire() if sk in closed state Date: Mon, 29 Jan 2018 13:57:03 +0100 Message-Id: <20180129123850.182096638@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123847.507563674@linuxfoundation.org> References: <20180129123847.507563674@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-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)