* Patch "tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0" has been added to the 4.9-stable tree
@ 2017-09-15 6:22 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-09-15 6:22 UTC (permalink / raw)
To: weiwan, andreyknvl, davem, edumazet, gregkh, ncardwell, ycheng
Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
tcp-initialize-rcv_mss-to-tcp_min_mss-instead-of-0.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From foo@baz Thu Sep 14 23:20:08 PDT 2017
From: Wei Wang <weiwan@google.com>
Date: Thu, 18 May 2017 11:22:33 -0700
Subject: tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0
From: Wei Wang <weiwan@google.com>
[ Upstream commit 499350a5a6e7512d9ed369ed63a4244b6536f4f8 ]
When tcp_disconnect() is called, inet_csk_delack_init() sets
icsk->icsk_ack.rcv_mss to 0.
This could potentially cause tcp_recvmsg() => tcp_cleanup_rbuf() =>
__tcp_select_window() call path to have division by 0 issue.
So this patch initializes rcv_mss to TCP_MIN_MSS instead of 0.
Reported-by: Andrey Konovalov <andreyknvl@google.com>
Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
net/ipv4/tcp.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2297,6 +2297,10 @@ int tcp_disconnect(struct sock *sk, int
tcp_set_ca_state(sk, TCP_CA_Open);
tcp_clear_retrans(tp);
inet_csk_delack_init(sk);
+ /* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0
+ * issue in __tcp_select_window()
+ */
+ icsk->icsk_ack.rcv_mss = TCP_MIN_MSS;
tcp_init_send_head(sk);
memset(&tp->rx_opt, 0, sizeof(tp->rx_opt));
__sk_dst_reset(sk);
Patches currently in stable-queue which might be from weiwan@google.com are
queue-4.9/ipv6-fix-sparse-warning-on-rt6i_node.patch
queue-4.9/tcp-initialize-rcv_mss-to-tcp_min_mss-instead-of-0.patch
queue-4.9/ipv6-add-rcu-grace-period-before-freeing-fib6_node.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-09-15 6:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-15 6:22 Patch "tcp: initialize rcv_mss to TCP_MIN_MSS instead of 0" has been added to the 4.9-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).