[<prev] [next>] [day] [month] [year] [list]
Message-ID: <483D068F.8050201@cn.fujitsu.com>
Date: Wed, 28 May 2008 15:15:27 +0800
From: Yang Hongyang <yanghy@...fujitsu.com>
To: yoshfuji@...ux-ipv6.org
CC: netdev@...r.kernel.org, davem@...set.davemloft.net
Subject: [PATCH] IPv6: Fix the data length of get destination options with
short length
If get destination options with length which is not enough for that
option,getsockopt() will still return the real length of the option,
which is larger then the buffer space.
This is because ipv6_getsockopt_sticky() returns the real length of
the option.
This patch fix this problem.
Signed-off-by: Yang Hongyang <yaonghy@...fujitsu.cm>
--- a/net/ipv6/ipv6_sockglue.c 2008-05-28 09:17:14.000000000 +0800
+++ b/net/ipv6/ipv6_sockglue.c 2008-05-28 12:41:01.000000000 +0800
@@ -832,7 +832,7 @@ static int ipv6_getsockopt_sticky(struct
len = min_t(unsigned int, len, ipv6_optlen(hdr));
if (copy_to_user(optval, hdr, len))
return -EFAULT;
- return ipv6_optlen(hdr);
+ return len;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists