Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp581546ybe; Fri, 6 Sep 2019 04:14:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPiQWLzCELSn4JYzk5hYOvVZLwmlva8kZxbH7VODjil/REnQ+Pmn6yBTh9EevDUkMM+/GN X-Received: by 2002:a17:902:4a:: with SMTP id 68mr2970799pla.196.1567768440359; Fri, 06 Sep 2019 04:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567768440; cv=none; d=google.com; s=arc-20160816; b=iCZWDvt/LAew3m13co/la98zTKXf7n5FJ4th2cheD9hdE3oM4RcFt4Dk4vdx3OHgd3 D9atKh4zvcR74V/wPSKXO7W7ifCdHLNpTaVVuZPtZGlq5UHF0Jcu1JWfpjSq1bV8mebJ knhrZF4HscUmNkcAOcfW93VMQ/w5bUjEq/T0xUIGVTkgp6mLZLJXQJZjxtXombopKjea OlROABxukoJ5p/M9WZWMAo1ZS6AR4YOglc/kudOmIf/QH3zgCEk4chUpO05EDzvOs9/D V8llkaUttR/r5xuzkEFvSXLZLE22pXsaFk3DAZZVA9NyRI1zt92E8HECEGmGRIkzjriW dQgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=ZmbnA0thUXqKuqZOgfec60DrSNfBsGpzuska9CsbrJk=; b=OYRPLopX8v9lOaMT/PubqTF5AcJgoicDSG2Dm5VEH119MKwznTAz4S+3n5kfVkhu0a KHbUOEKtRnBk0Gdd1cPazMup5sMj+X5f7wfJAoF6NYDK/sREc6Rzg7/8K+BP1UGneNrH a8vXW7rJlHV16mPuSuZ/ZNQpdnAWatvl4do22JjXrcqpZjEUSQMXVyXo5SfSXYkODDC2 8rtSVTzfTBZRB64JsLe18SuCy7IJBRpDBFjy4s8nMBkRVTZKfxrNEHZO3JZPzQB4q9oP gtMF3mOKioLgUDDfWS1Na55PV5UkkxTQoHWVtMhkFKoVFyMwqangOvOsO6sHSx2E2G/D rEIA== 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 i13si4391567pgf.335.2019.09.06.04.13.44; Fri, 06 Sep 2019 04:14:00 -0700 (PDT) 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 S2392970AbfIFJtk (ORCPT + 99 others); Fri, 6 Sep 2019 05:49:40 -0400 Received: from mail-sz.amlogic.com ([211.162.65.117]:46212 "EHLO mail-sz.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726462AbfIFJtj (ORCPT ); Fri, 6 Sep 2019 05:49:39 -0400 X-Greylist: delayed 903 seconds by postgrey-1.27 at vger.kernel.org; Fri, 06 Sep 2019 05:49:38 EDT Received: from localhost.localdomain (10.28.8.29) by mail-sz.amlogic.com (10.28.11.5) with Microsoft SMTP Server id 15.1.1591.10; Fri, 6 Sep 2019 17:35:25 +0800 From: chunguo feng To: CC: , , , , , , , , , , , fengchunguo Subject: [PATCH] tcp: fix tcp_disconnect() not clear tp->fastopen_rsk sometimes Date: Fri, 6 Sep 2019 17:34:29 +0800 Message-ID: <20190906093429.930-1-chunguo.feng@amlogic.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.28.8.29] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: fengchunguo This patch avoids fastopen_rsk not be cleared every times, then occur the below BUG_ON: tcp_v4_destroy_sock ->BUG_ON(tp->fastopen_rsk); When playback some videos from netwrok,used tcp_disconnect continually. Call trace: kfree+0x210/0x250 tcp_v4_destroy_sock+0xb8/0x1b0 tcp_v6_destroy_sock+0x20/0x34 inet_csk_destroy_sock+0x58/0x114 tcp_done+0x144/0x148 tcp_rcv_state_process+0x5d4/0xe3c tcp_v4_do_rcv+0x74/0x240 tcp_v4_rcv+0xaac/0xba0 ip_local_deliver_finish+0xe8/0x25c ip_local_deliver+0x60/0x118 ip_rcv+0x70/0x108 __netif_receive_skb_core+0x6f8/0xb80 process_backlog+0xe4/0x1f4 napi_poll+0x94/0x1ec net_rx_action+0xe4/0x224 __do_softirq+0x16c/0x3bc do_softirq.part.15+0x70/0x74 do_softirq+0x24/0x2c netif_rx_ni+0x108/0x138 dhd_rxf_thread+0x134/0x1e4 kthread+0x114/0x140 ret_from_fork+0x10/0x18 Signed-off-by: fengchunguo --- net/ipv4/tcp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 61082065b26a..f5c354c0b24c 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2655,6 +2655,7 @@ int tcp_disconnect(struct sock *sk, int flags) /* Clean up fastopen related fields */ tcp_free_fastopen_req(tp); inet->defer_connect = 0; + tp->fastopen_rsk = 0; WARN_ON(inet->inet_num && !icsk->icsk_bind_hash); -- 2.22.0