Patch "tcp md5sig: Use skb's saddr when replying to an incoming segment" has been added to the 4.14-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
tcp md5sig: Use skb's saddr when replying to an incoming segment
to the 4.14-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-md5sig-use-skb-s-saddr-when-replying-to-an-incoming-segment.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Sun Dec 31 11:12:48 CET 2017
From: Christoph Paasch <[email protected]>
Date: Mon, 11 Dec 2017 00:05:46 -0800
Subject: tcp md5sig: Use skb's saddr when replying to an incoming segment
From: Christoph Paasch <[email protected]>
[ Upstream commit 30791ac41927ebd3e75486f9504b6d2280463bf0 ]
The MD5-key that belongs to a connection is identified by the peer's IP-address. When we are in tcp_v4(6)_reqsk_send_ack(), we are replying to an incoming segment from tcp_check_req() that failed the seq-number checks.
Thus, to find the correct key, we need to use the skb's saddr and not the daddr.
This bug seems to have been there since quite a while, but probably got unnoticed because the consequences are not catastrophic. We will call tcp_v4_reqsk_send_ack only to send a challenge-ACK back to the peer, thus the connection doesn't really fail.
--- net/ipv4/tcp_ipv4.c | 2 +- net/ipv6/tcp_ipv6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/ipv4/tcp_ipv4.c +1 -1
@@ -844,7 +844,7 @@ static void tcp_v4_reqsk_send_ack(consttcp_time_stamp_raw () +tcp_rsk (req)->ts_off, req->ts_recent,0 , -tcp_md5_do_lookup (sk, (union tcp_md5_addr *)&ip_hdr (skb)->daddr, +tcp_md5_do_lookup (sk, (union tcp_md5_addr *)&ip_hdr (skb)->saddr,AF_INET ),inet_rsk (req)->no_srccheck ?IP_REPLY_ARG_NOSRCCHECK :0 , ip_hdr(skb)->tos);
net/ipv6/tcp_ipv6.c +1 -1
@@ -988,7 +988,7 @@ static void tcp_v6_reqsk_send_ack(const req->rsk_rcv_wnd >>inet_rsk (req)->rcv_wscale,tcp_time_stamp_raw () +tcp_rsk (req)->ts_off, req->ts_recent, sk->sk_bound_dev_if, -tcp_v6_md5_do_lookup (sk, &ipv6_hdr (skb)->daddr), +tcp_v6_md5_do_lookup (sk, &ipv6_hdr (skb)->saddr), 0, 0); }
Patches currently in stable-queue which might be from [email protected] are
queue-4.14/tcp-md5sig-use-skb-s-saddr-when-replying-to-an-incoming-segment.patch