]> 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)
commitcb305c9dd8ee3bcb74a1aca6e84b20eba15a6a0e
tree0da5a49c681ef193212c875be01f0a30f0dba5cf
parent2c4f1b26f4481da1fb839664f2627e7b4a73dd6f
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