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] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1106070910410.10360@nitsch.suse.de>
Date:	Tue, 7 Jun 2011 09:25:01 +0200 (CEST)
From:	Reinhard Max <max@...e.de>
To:	Marcus Meissner <meissner@...e.de>
Cc:	David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH] net/ipv6: check for mistakenly passed in non-AF_INET6
 sockaddrs

On Mon, 6 Jun 2011 at 18:00, Marcus Meissner wrote:

> Same check as for IPv4, also do for IPv6.
> [...]
> +
> +	if (addr->sin6_family != AF_INET6)
> +		return -EINVAL;
> +

According to the POSIX manpage for bind(), the error code should be 
EAFNOSUPPORT ("The specified address is not a valid address for the 
address family of the specified socket"). This would also match the 
error code of connect() in the same situation.

And I think the family should be checked before the length for both, 
bind() and connect(), to get more descriptive error messages when 
passing an address of the wrong family.


cu
 	Reinhard
--
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