[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>

authored by Chris Wright and committed by David S. Miller d2b02ed9 dfee0a72

+1 -1
+1 -1
net/ipv6/ipv6_sockglue.c
··· 804 return 0; 805 hdr = opt->hopopt; 806 807 - len = min_t(int, len, ipv6_optlen(hdr)); 808 if (copy_to_user(optval, hdr, ipv6_optlen(hdr))) 809 return -EFAULT; 810 return len;
··· 804 return 0; 805 hdr = opt->hopopt; 806 807 + len = min_t(unsigned int, len, ipv6_optlen(hdr)); 808 if (copy_to_user(optval, hdr, ipv6_optlen(hdr))) 809 return -EFAULT; 810 return len;