Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp895722ybe; Fri, 6 Sep 2019 08:53:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxIJzHsAspJ8+rMg1Eb867BIAiy/58c2+IBcTp2la+rdeutyp6opO+3QKX+5aGChFSojxPM X-Received: by 2002:a65:690e:: with SMTP id s14mr3277004pgq.47.1567785229655; Fri, 06 Sep 2019 08:53:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567785229; cv=none; d=google.com; s=arc-20160816; b=A5lp7Cu+V8QpB4F+FUuqOHjXXDRJlbN0XrjCRZ12150zFGIzwSZ9FqwVkJnG/ve0CI wLkPnzzexAZYg8D5GLN2YzZXqGWeilR+zS/Wx7RUV5mzMWpUC+3bJHiboqvA7eoNf8qq T4j5Veo7XyVl6DzEkuGZoac42VsKSulE0S26r1piAIeyjcxwJnh8i101QzTp8pvRtQ45 K9LVUcuRZVhkmZdKgubGnRYCtm2g3VqR1muPAlAw4v1IDn8o8zrW7FED9+bYNtmV0Awo Zw5As2qNDslK0rOPiz+ZPo1CS1HYSbUH7wbpYLTEl/5YDjV5BrxTnAsccHqiSbxNxUEb fyrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=65kVRSd8L6r82UlwVzMF798b1GwajejAzPsNu4zkBd4=; b=Yh0Vi7VhHvirBLZP13k3Up+8QCeeIArVofJs5UmJF0TKJh+BrFxIvxt61Zq39cEHTO 6eYKezbRpI7iq1RNw43FCPPMlmljU4gs213l+c4S9NhgVVe1GQhxePdrwZ79Z/Kf8Sh6 jDV3xRXWO0XLrcNR4axeqEn0JONss2F/I0gI+xaStxZl7LwpN2tS0VBHHfxhiyLUtagy +EYQ4oT+3RKTWcSVkHlNdGS3yRzORqTza1n2xB2TBxNkhZwATdIJ3rLjdQ6LsxLNpkIk GEctGDCpfNVduYcaZXKlCw8JhMnJmkN1yASX2j7eLE1xF5chePUknpD7FIsq5kLDUflv OcQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=cNtLs7t7; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2si3139146pls.351.2019.09.06.08.53.33; Fri, 06 Sep 2019 08:53:49 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=cNtLs7t7; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393124AbfIFKdQ (ORCPT + 99 others); Fri, 6 Sep 2019 06:33:16 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:37417 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393114AbfIFKdP (ORCPT ); Fri, 6 Sep 2019 06:33:15 -0400 Received: by mail-yb1-f195.google.com with SMTP id t5so2002985ybt.4 for ; Fri, 06 Sep 2019 03:33:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=65kVRSd8L6r82UlwVzMF798b1GwajejAzPsNu4zkBd4=; b=cNtLs7t70/jENml7I67T2qq/VnnyS6oVPTZ7t23q2zNAANfHm94FqvGIz5/A0B7lI1 yL55SqSaei7LxwdaPyritIGoz5+etu/qTp/kFN56tqjjX3LdoeXx1SOcdfyhzdERmzrr Ybkgp1cfMf5YFJ6HlnUsQgV2FrVo1pK2NBnnp2qDKid9bM2CZ/hsPUTMzbaINBY5Nix+ z5ewMczg71ofUthuAF0uJW6xR30xHT5NwhVmvOi5Mlqv2Rc/oSw8j2FBb6rBtMbLmzop cbnNyI+opTA0Sp4iWspHo0bGkPN04st+UR8dyeAe4UeeC3EOTbnV5VlXTwtDOa6iY68N +a1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=65kVRSd8L6r82UlwVzMF798b1GwajejAzPsNu4zkBd4=; b=CVEGQtZMWc82lrLunYICNAKNyivLaa7LvZi3nC6Gn/xjYoYXsl2TTIxtuDvu6ZrVTi gqcvZntE0wfYrpUIWgofmOU9hAXREHjX2OFOQmZvt5K4OXCUv7lKyPyIMLs1pg24ODSN zWp6ikICoPDFdtp2tKYZ//V37i1JcpJkcqpfj50DhP8sdKP70xcYzOhcqFcp5GRg8f5R WEkp57509qaRHAdDqVt5NPpQhyrcYwyFkqfF3D+T5VkSJB7wtq5jN9K9XuyOMIwCSgaN szqiyG7PGofFN4LLjLl5pfl+2Tifl2B35rHmQr1GU7E4Yc+g3WMxG1YjOc5J4C1pglYn Pd/w== X-Gm-Message-State: APjAAAVlM9Hm31V6ywqwQZn4EJQHmpIqFFK97oTM4H8Wrrtwt1F+y8ki m8ayGarFtIzs1CjcrP4KdRC2RZJoYctvNRvamsnh/Q== X-Received: by 2002:a25:ca51:: with SMTP id a78mr5614515ybg.303.1567765993696; Fri, 06 Sep 2019 03:33:13 -0700 (PDT) MIME-Version: 1.0 References: <20190906093429.930-1-chunguo.feng@amlogic.com> In-Reply-To: <20190906093429.930-1-chunguo.feng@amlogic.com> From: Eric Dumazet Date: Fri, 6 Sep 2019 12:33:02 +0200 Message-ID: Subject: Re: [PATCH] tcp: fix tcp_disconnect() not clear tp->fastopen_rsk sometimes To: chunguo feng , Yuchung Cheng , Neal Cardwell Cc: David Miller , Alexei Starovoitov , Daniel Borkmann , netdev , Yonghong Song , LKML 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 On Fri, Sep 6, 2019 at 11:34 AM chunguo feng wrote: > > 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. Wow, tcp_disconnect() being used by something else than syzkaller ! > 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); > This seems suspicious to me. Are we leaking a block of memory after your patch ? If the block of memory has been freed, maybe clear the pointer at the place the free happened ? I am traveling to Lisbon for LPC, maybe Yuchung or Neal can take a look.