netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: adobriyan@gmail.com
Cc: eric.dumazet@gmail.com, shemminger@linux-foundation.org,
	netdev@vger.kernel.org, bhutchings@solarflare.com
Subject: Re: [PATCH v2] tcp: restrict net.ipv4.tcp_adv_win_scale (#20312)
Date: Sun, 28 Nov 2010 10:39:20 -0800 (PST)	[thread overview]
Message-ID: <20101128.103920.226762370.davem@davemloft.net> (raw)
In-Reply-To: <20101122225421.GA7372@core2.telecom.by>

From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Tue, 23 Nov 2010 00:54:21 +0200

> tcp_win_from_space() does the following:
> 
>       if (sysctl_tcp_adv_win_scale <= 0)
>               return space >> (-sysctl_tcp_adv_win_scale);
>       else
>               return space - (space >> sysctl_tcp_adv_win_scale);
> 
> "space" is int.
> 
> As per C99 6.5.7 (3) shifting int for 32 or more bits is
> undefined behaviour.
> 
> Indeed, if sysctl_tcp_adv_win_scale is exactly 32,
> space >> 32 equals space and function returns 0.
> 
> Which means we busyloop in tcp_fixup_rcvbuf().
> 
> Restrict net.ipv4.tcp_adv_win_scale to [-31, 31].
> 
> Fix https://bugzilla.kernel.org/show_bug.cgi?id=20312
> 
> Steps to reproduce:
> 
>       echo 32 >/proc/sys/net/ipv4/tcp_adv_win_scale
>       wget www.kernel.org
>       [softlockup]
> 
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

I'll aply this, thanks Alexey.

      reply	other threads:[~2010-11-28 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-14 15:18 [PATCH] tcp: restrict net.ipv4.tcp_adv_min_scale (#20312) Alexey Dobriyan
2010-11-14 19:49 ` Eric Dumazet
2010-11-14 20:14   ` Alexey Dobriyan
2010-11-15 14:18     ` Ben Hutchings
2010-11-22 22:54       ` [PATCH v2] tcp: restrict net.ipv4.tcp_adv_win_scale (#20312) Alexey Dobriyan
2010-11-28 18:39         ` David Miller [this message]

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=20101128.103920.226762370.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=adobriyan@gmail.com \
    --cc=bhutchings@solarflare.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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).