tcp: avoid integer overflows in tcp_rcv_space_adjust()
authorEric Dumazet <edumazet@google.com>
Mon, 11 Dec 2017 01:55:03 +0000 (17:55 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 5 Jun 2018 09:41:58 +0000 (11:41 +0200)
commita6f81fcb2c3905c28641837dc823ed34617eb110
treede6c6ebef8583dd97cb49a2cd2a6e61b762b1927
parent96b086a7bfe575c3626cf2a9af301539c2623b9b
tcp: avoid integer overflows in tcp_rcv_space_adjust()

commit 607065bad9931e72207b0cac365d7d4abc06bd99 upstream.

When using large tcp_rmem[2] values (I did tests with 500 MB),
I noticed overflows while computing rcvwin.

Lets fix this before the following patch.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Wei Wang <weiwan@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[Backport: sysctl_tcp_rmem is not Namespace-ify'd in older kernels]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/tcp.h
net/ipv4/tcp_input.c