lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Jan 2013 11:24:12 -0500
From:	Jeff Layton <jlayton@...hat.com>
To:	Nickolai Zeldovich <nickolai@...il.mit.edu>
Cc:	Steve French <sfrench@...ba.org>, linux-cifs@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cifs: fix srcip_matches() for ipv6

On Wed, 16 Jan 2013 21:36:17 -0500
Nickolai Zeldovich <nickolai@...il.mit.edu> wrote:

> srcip_matches() previously had code like this:
> 
>   srcip_matches(..., struct sockaddr *rhs) {
>     /* ... */
>     struct sockaddr_in6 *vaddr6 = (struct sockaddr_in6 *) &rhs;
>     return ipv6_addr_equal(..., &vaddr6->sin6_addr);
>   }
> 
> which interpreted the values on the stack after the 'rhs' pointer as an
> ipv6 address.  The correct thing to do is to use 'rhs', not '&rhs'.
> 
> Signed-off-by: Nickolai Zeldovich <nickolai@...il.mit.edu>
> ---
>  fs/cifs/connect.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
> index 17c3643..12b3da3 100644
> --- a/fs/cifs/connect.c
> +++ b/fs/cifs/connect.c
> @@ -1917,7 +1917,7 @@ srcip_matches(struct sockaddr *srcaddr, struct sockaddr *rhs)
>  	}
>  	case AF_INET6: {
>  		struct sockaddr_in6 *saddr6 = (struct sockaddr_in6 *)srcaddr;
> -		struct sockaddr_in6 *vaddr6 = (struct sockaddr_in6 *)&rhs;
> +		struct sockaddr_in6 *vaddr6 = (struct sockaddr_in6 *)rhs;
>  		return ipv6_addr_equal(&saddr6->sin6_addr, &vaddr6->sin6_addr);
>  	}
>  	default:

Nice catch...

Reviewed-by: Jeff Layton <jlayton@...hat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ