diff options
author | Eric Dumazet <edumazet@google.com> | 2019-06-08 13:22:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-15 21:47:31 -0400 |
commit | 967c05aee439e6e5d7d805e195b3a20ef5c433d6 (patch) | |
tree | 564caa19735a085c9722d4fb8c184cc23dc7f012 | |
parent | 5f3e2bf008c2221478101ee72f5cb4654b9fc363 (diff) |
tcp: enforce tcp_min_snd_mss in tcp_mtu_probing()
If mtu probing is enabled tcp_mtu_probing() could very well end up
with a too small MSS.
Use the new sysctl tcp_min_snd_mss to make sure MSS search
is performed in an acceptable range.
CVE-2019-11479 -- tcp mss hardcoded to 48
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Cc: Jonathan Looney <jtl@netflix.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Tyler Hicks <tyhicks@canonical.com>
Cc: Bruce Curtis <brucec@netflix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | net/ipv4/tcp_timer.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 5bad937ce779..c801cd37cc2a 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c | |||
@@ -155,6 +155,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) | |||
155 | mss = tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_low) >> 1; | 155 | mss = tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_low) >> 1; |
156 | mss = min(net->ipv4.sysctl_tcp_base_mss, mss); | 156 | mss = min(net->ipv4.sysctl_tcp_base_mss, mss); |
157 | mss = max(mss, 68 - tcp_sk(sk)->tcp_header_len); | 157 | mss = max(mss, 68 - tcp_sk(sk)->tcp_header_len); |
158 | mss = max(mss, net->ipv4.sysctl_tcp_min_snd_mss); | ||
158 | icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, mss); | 159 | icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, mss); |
159 | } | 160 | } |
160 | tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); | 161 | tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); |