]> git.baikalelectronics.ru Git - kernel.git/commit
net: Update window_clamp if SOCK_RCVBUF is set
authorMao Wenan <wenan.mao@linux.alibaba.com>
Tue, 10 Nov 2020 00:16:31 +0000 (08:16 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 11 Nov 2020 01:42:35 +0000 (17:42 -0800)
commitc5dcc1f2ddf23a10e5cb7cf64ddfbf75302452a9
tree0da5a49c681ef193212c875be01f0a30f0dba5cf
parent6a59cc30eb6363f1d42b09a179912e401d13d253
net: Update window_clamp if SOCK_RCVBUF is set

When net.ipv4.tcp_syncookies=1 and syn flood is happened,
cookie_v4_check or cookie_v6_check tries to redo what
tcp_v4_send_synack or tcp_v6_send_synack did,
rsk_window_clamp will be changed if SOCK_RCVBUF is set,
which will make rcv_wscale is different, the client
still operates with initial window scale and can overshot
granted window, the client use the initial scale but local
server use new scale to advertise window value, and session
work abnormally.

Fixes: 8c7d7b4403c0 ("tcp: allow effective reduction of TCP's rcv-buffer via setsockopt")
Signed-off-by: Mao Wenan <wenan.mao@linux.alibaba.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/1604967391-123737-1-git-send-email-wenan.mao@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/syncookies.c
net/ipv6/syncookies.c