Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5268f12f26f1f51590cd1ed26547e21c46b08f2
Commit:     e5268f12f26f1f51590cd1ed26547e21c46b08f2
Parent:     4c6510a738c71ca6b4b7b624a7d0a00acebfd7fb
Author:     YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 8 20:48:23 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:24:17 2007 -0700

    [IPV6]: Ensure to truncate result and return full length for sticky options.
    
    Bug noticed by Chris Wright <[EMAIL PROTECTED]>.
    
    Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv6/ipv6_sockglue.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index eceed09..1d56b46 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -825,9 +825,9 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct 
ipv6_txoptions *opt,
                return 0;
 
        len = min_t(unsigned int, len, ipv6_optlen(hdr));
-       if (copy_to_user(optval, hdr, ipv6_optlen(hdr)))
+       if (copy_to_user(optval, hdr, len));
                return -EFAULT;
-       return len;
+       return ipv6_optlen(hdr);
 }
 
 static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to