From: Eric Dumazet <eric.dumazet@gmail.com>
To: Jun Chen <jun.d.chen@intel.com>
Cc: ycheng@google.com, ncardwell@google.com, edumazet@google.com,
netdev@vger.kernel.org,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] tcp: Modify the condition for the first skb to collapse
Date: Mon, 17 Jun 2013 01:15:35 -0700 [thread overview]
Message-ID: <1371456935.3252.177.camel@edumazet-glaptop> (raw)
In-Reply-To: <1371478739.10495.5.camel@chenjun-workstation>
On Mon, 2013-06-17 at 10:18 -0400, Jun Chen wrote:
> When search the first skb to collapse,the condition of overlap to the next one have been
> reached,but the start is less than TCP_SKB_CB(skb)->seq at this time, then followed process
> will trigger the BUG_ON of the offset(start - TCP_SKB_CB(skb)->seq).
> So this patch add one check (! before(start,TCP_SKB_CB(skb)->seq)) to avoid this ipanic.
>
> Signed-off-by: Chen Jun <jun.d.chen@intel.com>
> ---
> net/ipv4/tcp_input.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 9c62257..4c745c5 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -4465,7 +4465,8 @@ restart:
> * overlaps to the next one.
> */
> if (!tcp_hdr(skb)->syn && !tcp_hdr(skb)->fin &&
> - (tcp_win_from_space(skb->truesize) > skb->len ||
> + ((tcp_win_from_space(skb->truesize) > skb->len &&
> + !before(start, TCP_SKB_CB(skb)->seq)) ||
> before(TCP_SKB_CB(skb)->seq, start))) {
> end_of_skbs = false;
> break;
Hmm... I must say I do not understand this patch.
If we find a skb with before(TCP_SKB_CB(skb)->seq, start), then the
final condition will be true.
Let's rewrite your code to equivalent one :
if (!tcp_hdr(skb)->syn && !tcp_hdr(skb)->fin &&
(before(TCP_SKB_CB(skb)->seq, start) ||
tcp_win_from_space(skb->truesize) > skb->len)) {
So it seems your patch would not solve the problem for all
possible skbs (aka not bloated) ?
Please tell us how you trigger this bug, and send the stack trace.
Thanks
next prev parent reply other threads:[~2013-06-17 8:15 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-17 14:18 [PATCH] tcp: Modify the condition for the first skb to collapse Jun Chen
2013-06-17 8:15 ` Eric Dumazet [this message]
2013-06-17 17:29 ` Jun Chen
2013-06-17 10:29 ` Eric Dumazet
2013-06-17 18:52 ` Jun Chen
2013-06-17 13:21 ` Eric Dumazet
2013-06-18 9:52 ` Jun Chen
2013-06-18 5:53 ` Eric Dumazet
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=1371456935.3252.177.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=edumazet@google.com \
--cc=jun.d.chen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=ycheng@google.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