summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2007-03-11 07:43:46 +0100
committerAdrian Bunk <bunk@stusta.de>2007-03-11 07:43:46 +0100
commit3c872db41104b651851b10784b0a99c8e268c89c (patch)
tree45812b12e927aa4820d8f366c55193a008ec9eae
parent6d2c0df71d1ecc0ed52f0631c6aee8d7f992cc43 (diff)
[IPV6] fix ipv6_getsockopt_sticky copy_to_user leak
User supplied len < 0 can cause leak of kernel memory. Use unsigned compare instead. Signed-off-by: Chris Wright <chrisw@sous-sol.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Adrian Bunk <bunk@stusta.de>
-rw-r--r--net/ipv6/ipv6_sockglue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 4c2a9a2e9053..0ca2526dd2e7 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -640,7 +640,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
return 0;
hdr = opt->hopopt;
- len = min_t(int, len, ipv6_optlen(hdr));
+ len = min_t(unsigned int, len, ipv6_optlen(hdr));
if (copy_to_user(optval, hdr, ipv6_optlen(hdr)))
return -EFAULT;
return len;