From: chunguo feng <chunguo.feng@amlogic.com>
To: <edumazet@google.com>
Cc: <davem@davemloft.net>, <kuznet@ms2.inr.ac.ru>,
<yoshfuji@linux-ipv6.org>, <ast@kernel.org>,
<daniel@iogearbox.net>, <netdev@vger.kernel.org>, <kafai@fb.com>,
<songliubraving@fb.com>, <yhs@fb.com>,
<linux-kernel@vger.kernel.org>, <bpf@vger.kernel.org>,
fengchunguo <chunguo.feng@amlogic.com>
Subject: [PATCH] tcp: fix tcp_disconnect() not clear tp->fastopen_rsk sometimes
Date: Fri, 6 Sep 2019 17:34:29 +0800 [thread overview]
Message-ID: <20190906093429.930-1-chunguo.feng@amlogic.com> (raw)
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.
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 <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);
--
2.22.0
next reply other threads:[~2019-09-06 9:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-06 9:34 chunguo feng [this message]
2019-09-06 10:33 ` [PATCH] tcp: fix tcp_disconnect() not clear tp->fastopen_rsk sometimes Eric Dumazet
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=20190906093429.930-1-chunguo.feng@amlogic.com \
--to=chunguo.feng@amlogic.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kafai@fb.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=songliubraving@fb.com \
--cc=yhs@fb.com \
--cc=yoshfuji@linux-ipv6.org \
/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).