Skip to contentSkip to conversation

Update to 2.6.9-pre networking

PATCH David S. Miller 1 participant 1 message Aug 19, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Two bugs fixed:

1) tcp_init_metrics needs to setup rtt_seq
2) ICMP xfrm changes were dereferencing user pointers directly

Available at:

	bk://kernel.bkbits.net/davem/net-2.6
	ftp.kernel.org:/pub/linux/kernel/people/davem/net-2.6.7-2.diff.gz

Enjoy.

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/08/18 17:56:52-07:00 [email protected]
# [TCP]: When fetching srtt from metrics, do not forget to set rtt_seq.
#

#   Otherwise RTT will end up being wrong for a long
#   time, because tcp_rtt_estimator() requires that
#   every time srtt is set, rtt_seq is set too.
#   
#   Signed-off-by: David S. Miller <[email protected]>
# 
# net/ipv4/tcp_input.c
#   2004/08/18 17:55:57-07:00 [email protected] +3 -1
#   [TCP]: When fetching srtt from metrics, do not forget to set rtt_seq.
# 
diff -Nru a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
--- a/net/ipv4/tcp_input.c	2004-08-19 05:47:01 -07:00
+++ b/net/ipv4/tcp_input.c	2004-08-19 05:47:01 -07:00
@@ -852,8 +852,10 @@
 	 * to low value, and then abruptly stops to do it and starts to delay
 	 * ACKs, wait for troubles.
 	 */
-	if (dst_metric(dst, RTAX_RTT) > tp->srtt)
+	if (dst_metric(dst, RTAX_RTT) > tp->srtt) {
 		tp->srtt = dst_metric(dst, RTAX_RTT);
+		tp->rtt_seq = tp->snd_nxt;
+	}
 	if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) {
 		tp->mdev = dst_metric(dst, RTAX_RTTVAR);
 		tp->mdev_max = tp->rttvar = max(tp->mdev, TCP_RTO_MIN);
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/08/18 22:17:01-07:00 [email protected] 
#   [IPV4/IPV6]: Fix direct user pointer deref in xfrm icmp changes.
#   
#   Signed-off-by: David S. Miller <[email protected]>
# 
# net/ipv6/raw.c
#   2004/08/18 22:16:27-07:00 [email protected] +4 -4
#   [IPV4/IPV6]: Fix direct user pointer deref in xfrm icmp changes.
# 
# net/ipv4/raw.c
#   2004/08/18 22:16:27-07:00 [email protected] +4 -4
#   [IPV4/IPV6]: Fix direct user pointer deref in xfrm icmp changes.
# 
diff -Nru a/net/ipv4/raw.c b/net/ipv4/raw.c
--- a/net/ipv4/raw.c	2004-08-19 05:47:09 -07:00
+++ b/net/ipv4/raw.c	2004-08-19 05:47:09 -07:00
@@ -326,8 +326,8 @@
 static void raw_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
 {
 	struct iovec *iov;
-	u8 *type = NULL;
-	u8 *code = NULL;
+	u8 __user *type = NULL;
+	u8 __user *code = NULL;
 	int probed = 0;
 	int i;

@@ -354,8 +354,8 @@
code = iov->iov_base;

if (type && code) {
- fl->fl_icmp_type = *type;
- fl->fl_icmp_code = *code;
+ get_user(fl->fl_icmp_type, type);
+ __get_user(fl->fl_icmp_code, code);
probed = 1;
}
break;

net/ipv6/raw.c +4 -4
diff -Nru a/net/ipv6/raw.c b/net/ipv6/raw.c
@@ -559,8 +559,8 @@
 static void rawv6_probe_proto_opt(struct flowi *fl, struct msghdr *msg)
 {
 	struct iovec *iov;
-	u8 *type = NULL;
-	u8 *code = NULL;
+	u8 __user *type = NULL;
+	u8 __user *code = NULL;
 	int probed = 0;
 	int i;
 
@@ -587,8 +587,8 @@
 				code = iov->iov_base;
 
 			if (type && code) {
-				fl->fl_icmp_type = *type;
-				fl->fl_icmp_code = *code;
+				get_user(fl->fl_icmp_type, type);
+				__get_user(fl->fl_icmp_code, code);
 				probed = 1;
 			}
 			break;