projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dfee0a7
)
[IPV6] fix ipv6_getsockopt_sticky copy_to_user leak
author
Chris Wright
<chrisw@sous-sol.org>
Sat, 10 Mar 2007 00:19:17 +0000
(16:19 -0800)
committer
David S. Miller
<davem@davemloft.net>
Sat, 10 Mar 2007 00:19:17 +0000
(16:19 -0800)
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>
net/ipv6/ipv6_sockglue.c
patch
|
blob
|
history
diff --git
a/net/ipv6/ipv6_sockglue.c
b/net/ipv6/ipv6_sockglue.c
index b82333b9228fdb6e405351cfe32ad6f431cc62a6..f5f9582a8d39554c120ed147ddc9f71105d6a889 100644
(file)
--- 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,
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;