[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20101128.103920.226762370.davem@davemloft.net>
Date: Sun, 28 Nov 2010 10:39:20 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: adobriyan@...il.com
Cc: eric.dumazet@...il.com, shemminger@...ux-foundation.org,
netdev@...r.kernel.org, bhutchings@...arflare.com
Subject: Re: [PATCH v2] tcp: restrict net.ipv4.tcp_adv_win_scale (#20312)
From: Alexey Dobriyan <adobriyan@...il.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@...il.com>
I'll aply this, thanks Alexey.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists