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]
Message-ID: <20250904092516.GD372207@horms.kernel.org>
Date: Thu, 4 Sep 2025 10:25:16 +0100
From: Simon Horman <horms@...nel.org>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: "David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Joanne Koong <joannelkoong@...il.com>,
	Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v1 net] selftest: net: Fix weird setsockopt() in
 bind_bhash.c.

On Wed, Sep 03, 2025 at 10:28:51PM +0000, Kuniyuki Iwashima wrote:
> bind_bhash.c passes (SO_REUSEADDR | SO_REUSEPORT) to setsockopt().
> 
> In the asm-generic definition, the value happens to match with the
> bare SO_REUSEPORT, (2 | 15) == 15, but not on some arch.
> 
> arch/alpha/include/uapi/asm/socket.h:18:#define SO_REUSEADDR	0x0004
> arch/alpha/include/uapi/asm/socket.h:24:#define SO_REUSEPORT	0x0200
> arch/mips/include/uapi/asm/socket.h:24:#define SO_REUSEADDR	0x0004	/* Allow reuse of local addresses.  */
> arch/mips/include/uapi/asm/socket.h:33:#define SO_REUSEPORT 0x0200	/* Allow local address and port reuse.  */
> arch/parisc/include/uapi/asm/socket.h:12:#define SO_REUSEADDR	0x0004
> arch/parisc/include/uapi/asm/socket.h:18:#define SO_REUSEPORT	0x0200
> arch/sparc/include/uapi/asm/socket.h:13:#define SO_REUSEADDR	0x0004
> arch/sparc/include/uapi/asm/socket.h:20:#define SO_REUSEPORT	0x0200
> include/uapi/asm-generic/socket.h:12:#define SO_REUSEADDR	2
> include/uapi/asm-generic/socket.h:27:#define SO_REUSEPORT	15
> 
> Let's pass SO_REUSEPORT only.
> 
> Fixes: c35ecb95c448 ("selftests/net: Add test for timing a bind request to a port with a populated bhash entry")
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>

Reviewed-by: Simon Horman <horms@...nel.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ