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:	Sat, 21 Dec 2013 13:44:40 +0100
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	Alexander Aring <alex.aring@...il.com>
Cc:	Trond.Myklebust@...app.com, linux-nfs@...r.kernel.org,
	netdev@...r.kernel.org, werner@...esberger.net
Subject: Re: [PATCH] nfs: fix dead code of ipv6_addr_scope

On Sat, Dec 21, 2013 at 05:39:04AM +0100, Alexander Aring wrote:
> The correct way to check on IPV6_ADDR_SCOPE_LINKLOCAL is to check with
> the ipv6_addr_src_scope function.
> 
> Currently this can't be work, because ipv6_addr_scope returns a int with
> a mask of IPV6_ADDR_SCOPE_MASK (0x00f0U) and IPV6_ADDR_SCOPE_LINKLOCAL
> is 0x02. So the condition is always false.
> 
> Signed-off-by: Alexander Aring <alex.aring@...il.com>
> ---
> I think ipv6_addr_src_scope should be correct, can somebody from netdev ml
> confirm this please?
> I stumple over that and I did not compile and test it. Maybe this is something
> for stable?
> 
>  fs/nfs/nfs4filelayoutdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/nfs/nfs4filelayoutdev.c b/fs/nfs/nfs4filelayoutdev.c
> index c7c295e5..efac602 100644
> --- a/fs/nfs/nfs4filelayoutdev.c
> +++ b/fs/nfs/nfs4filelayoutdev.c
> @@ -95,7 +95,7 @@ same_sockaddr(struct sockaddr *addr1, struct sockaddr *addr2)
>  		b6 = (struct sockaddr_in6 *)addr2;
>  
>  		/* LINKLOCAL addresses must have matching scope_id */
> -		if (ipv6_addr_scope(&a6->sin6_addr) ==
> +		if (ipv6_addr_src_scope(&a6->sin6_addr) ==
>  		    IPV6_ADDR_SCOPE_LINKLOCAL &&
>  		    a6->sin6_scope_id != b6->sin6_scope_id)
>  			return false;

Good catch!

SCOPE_TYPE also can be compared and is no bitfield, so the patch is
good. Do you mind also proposing a patch for sctp?

Thanks,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ