aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorChris Wright <chrisw@sous-sol.org>2007-03-09 19:19:17 -0500
committerDavid S. Miller <davem@davemloft.net>2007-03-09 19:19:17 -0500
commitd2b02ed9487ed25832d19534575052e43f8e0c4f (patch)
tree292944e3306f4209dde7ffc18e36fc3d6e3fd8d7 /net
parentdfee0a725bb027b749ffdd318eb48b91d564b266 (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>
Diffstat (limited to 'net')
-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 b82333b9228f..f5f9582a8d39 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -804,7 +804,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
804 return 0; 804 return 0;
805 hdr = opt->hopopt; 805 hdr = opt->hopopt;
806 806
807 len = min_t(int, len, ipv6_optlen(hdr)); 807 len = min_t(unsigned int, len, ipv6_optlen(hdr));
808 if (copy_to_user(optval, hdr, ipv6_optlen(hdr))) 808 if (copy_to_user(optval, hdr, ipv6_optlen(hdr)))
809 return -EFAULT; 809 return -EFAULT;
810 return len; 810 return len;