From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,USER_AGENT_GIT,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C803C43381 for ; Fri, 15 Feb 2019 21:36:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 45929222D7 for ; Fri, 15 Feb 2019 21:36:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OwUetKSM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392301AbfBOVgn (ORCPT ); Fri, 15 Feb 2019 16:36:43 -0500 Received: from mail-vk1-f202.google.com ([209.85.221.202]:55201 "EHLO mail-vk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728755AbfBOVgn (ORCPT ); Fri, 15 Feb 2019 16:36:43 -0500 Received: by mail-vk1-f202.google.com with SMTP id b189so4567836vke.21 for ; Fri, 15 Feb 2019 13:36:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=uYiZRAQrL0wSvtyGQ2/x/fhpleP7ebpOTfm+QlObRg4=; b=OwUetKSMiyLBVS1g9MQDDBBCpX++XKA9dSfnu6UY3ZsUHPhn3AK8Ps6XjQZkByi60l mjdmiOyHNaojTngme0lPDLEIIofM9ga59V5e8+j/TkzxKU3yKkgZi2C7PWhMSdua+TkF l9NAj9PBocVtta3ZaEjmKrB0hgMzsIQO4E4qJVWoeTPsBu+vnRraCMTT4BM1UCZ+1Epc xt31fQl2X5Z7x0tWmwP1goy11wPta1kgdHBqw6OTOt1pfuzxamMSNJ5WXq3CqyUic2Si zlp2UzTUOWMa1FEi30uaZcS1IOrKKuOyEc77a5BX6SLVjaypH1VRcZfpSjZTObVMMsxJ rkDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=uYiZRAQrL0wSvtyGQ2/x/fhpleP7ebpOTfm+QlObRg4=; b=UDcptgyCOGKqYoF6ZYNyG3S3CzIbBUZ16yLFJaumMjesDJZ9aTY2iMmicNB96eDza/ Wjez0iG6VqbWZq+Sl3zE34syB5xTuCR/BNoTbMmleChNKUh3eSrWc3qEe1iSXu4JKpRG exI9rfsJlNqV83ESOAxHiVANG+6/J9xaDG6d4r19S+Npihc3fDmMKrf9rFLflwKgu5mB kqRzigzNr/07Uo21zXc3GQIxCSK2AW3CTL13ONH7dZfMtSIty0mqi4dw1VtAibElbcqZ iUtid4ZjPTCEyljUpQClBn1jOcq++DFZhqpO5IVP3Mygu4bR1LOnVz2P58sWN3mAjsLV gwFQ== X-Gm-Message-State: AHQUAuY5flePH8vvHkdhEdgC09s8Ovi9zvMhlhOHSFY9gDZVXSo84/mL XdemITWi+aM+W2tAagKFLeG++Bx21TCLzg== X-Google-Smtp-Source: AHgI3IYy9qkxEq2l+C0apx041K3CwVi7UqDYJ3fbaGvMGWCl1eSlB9v3t2+1k93fZWckJm6CRg5UxAxuvfXVrQ== X-Received: by 2002:a67:7884:: with SMTP id t126mr7507043vsc.35.1550266601984; Fri, 15 Feb 2019 13:36:41 -0800 (PST) Date: Fri, 15 Feb 2019 13:36:20 -0800 In-Reply-To: <20190215213621.183537-1-edumazet@google.com> Message-Id: <20190215213621.183537-2-edumazet@google.com> Mime-Version: 1.0 References: <20190215213621.183537-1-edumazet@google.com> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e-goog Subject: [PATCH net 1/2] tcp: clear icsk_backoff in tcp_write_queue_purge() From: Eric Dumazet To: "David S . Miller" Cc: netdev , Eric Dumazet , Eric Dumazet , Neal Cardwell , Yuchung Cheng , soukjin bae Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org soukjin bae reported a crash in tcp_v4_err() handling ICMP_DEST_UNREACH after tcp_write_queue_head(sk) returned a NULL pointer. Current logic should have prevented this : if (seq != tp->snd_una || !icsk->icsk_retransmits || !icsk->icsk_backoff || fastopen) break; Problem is the write queue might have been purged and icsk_backoff has not been cleared. Signed-off-by: Eric Dumazet Reported-by: soukjin bae --- net/ipv4/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 2079145a3b7c5f498af429c9a8289342e4421fca..cf3c5095c10e8e7e56621beae2f93c93de184489 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2528,6 +2528,7 @@ void tcp_write_queue_purge(struct sock *sk) sk_mem_reclaim(sk); tcp_clear_all_retrans_hints(tcp_sk(sk)); tcp_sk(sk)->packets_out = 0; + inet_csk(sk)->icsk_backoff = 0; } int tcp_disconnect(struct sock *sk, int flags) @@ -2576,7 +2577,6 @@ int tcp_disconnect(struct sock *sk, int flags) tp->write_seq += tp->max_window + 2; if (tp->write_seq == 0) tp->write_seq = 1; - icsk->icsk_backoff = 0; tp->snd_cwnd = 2; icsk->icsk_probes_out = 0; tp->snd_ssthresh = TCP_INFINITE_SSTHRESH; -- 2.21.0.rc0.258.g878e2cd30e-goog