linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: chunguo feng <chunguo.feng@amlogic.com>,
	Yuchung Cheng <ycheng@google.com>,
	Neal Cardwell <ncardwell@google.com>
Cc: David Miller <davem@davemloft.net>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	netdev <netdev@vger.kernel.org>, Yonghong Song <yhs@fb.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tcp: fix tcp_disconnect() not clear tp->fastopen_rsk sometimes
Date: Fri, 6 Sep 2019 12:33:02 +0200	[thread overview]
Message-ID: <CANn89iLK7oY0OZK+g+HadktByojxVbdbPj9d5ephYh0qs3fXRA@mail.gmail.com> (raw)
In-Reply-To: <20190906093429.930-1-chunguo.feng@amlogic.com>

On Fri, Sep 6, 2019 at 11:34 AM chunguo feng <chunguo.feng@amlogic.com> wrote:
>
> From: fengchunguo <chunguo.feng@amlogic.com>
>
> 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 <chunguo.feng@amlogic.com>
> ---
>  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.

  reply	other threads:[~2019-09-06 10:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-06  9:34 [PATCH] tcp: fix tcp_disconnect() not clear tp->fastopen_rsk sometimes chunguo feng
2019-09-06 10:33 ` Eric Dumazet [this message]
2019-09-10  8:09 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANn89iLK7oY0OZK+g+HadktByojxVbdbPj9d5ephYh0qs3fXRA@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=ast@kernel.org \
    --cc=chunguo.feng@amlogic.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).