]> git.karo-electronics.de Git - linux-beck.git/commit
tcp: fix 0 divide in __tcp_select_window()
authorEric Dumazet <edumazet@google.com>
Wed, 1 Feb 2017 16:33:53 +0000 (08:33 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Feb 2017 14:11:41 +0000 (15:11 +0100)
commitca876dff1e8c04871d019c57016514df4cf04a25
treebf317aaf5e4a40fcc33b8befb65a54245e452517
parente6fbace87c7b57ff6143df2bc18a9ca9ae919bbe
tcp: fix 0 divide in __tcp_select_window()

[ Upstream commit 06425c308b92eaf60767bc71d359f4cbc7a561f8 ]

syszkaller fuzzer was able to trigger a divide by zero, when
TCP window scaling is not enabled.

SO_RCVBUF can be used not only to increase sk_rcvbuf, also
to decrease it below current receive buffers utilization.

If mss is negative or 0, just return a zero TCP window.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp_output.c