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: <87ecv5fqv9.fsf@cloudflare.com>
Date: Fri, 27 Jun 2025 11:58:18 +0200
From: Jakub Sitnicki <jakub@...udflare.com>
To: netdev@...r.kernel.org
Cc: Eric Dumazet <edumazet@...gle.com>,  Paolo Abeni <pabeni@...hat.com>,
  "David S. Miller" <davem@...emloft.net>,  Jakub Kicinski
 <kuba@...nel.org>,  Neal Cardwell <ncardwell@...gle.com>,  Kuniyuki
 Iwashima <kuniyu@...gle.com>,  netdev@...r.kernel.org,
  kernel-team@...udflare.com,  Lee Valentine <lvalentine@...udflare.com>
Subject: Re: [PATCH net-next 1/2] tcp: Consider every port when connecting
 with IP_LOCAL_PORT_RANGE

On Fri, Jun 27, 2025 at 07:00 AM +08, kernel test robot wrote:
> All warnings (new ones prefixed by >>):
>
>>> net/ipv4/inet_hashtables.c:1015:21: warning: unused variable 'sk2' [-Wunused-variable]
>     1015 |         const struct sock *sk2;
>          |                            ^~~
>    1 warning generated.
>
>
> vim +/sk2 +1015 net/ipv4/inet_hashtables.c
>
>   1007	
>   1008	/* True on source address conflict with another socket. False otherwise.
>   1009	 * Caller must hold hashbucket lock for this tb.
>   1010	 */
>   1011	static inline bool check_bound(const struct sock *sk,
>   1012				       const struct inet_bind_bucket *tb)
>   1013	{
>   1014		const struct inet_bind2_bucket *tb2;
>> 1015		const struct sock *sk2;
>   1016	
>   1017		hlist_for_each_entry(tb2, &tb->bhash2, bhash_node) {
>   1018	#if IS_ENABLED(CONFIG_IPV6)
>   1019			if (sk->sk_family == AF_INET6) {
>   1020				if (tb2->addr_type == IPV6_ADDR_ANY ||
>   1021				    ipv6_addr_equal(&tb2->v6_rcv_saddr,
>   1022						    &sk->sk_v6_rcv_saddr))
>   1023					return true;
>   1024				continue;
>   1025			}
>   1026	
>   1027			/* Check for ipv6 non-v6only wildcard sockets */
>   1028			if (tb2->addr_type == IPV6_ADDR_ANY)
>   1029				sk_for_each_bound(sk2, &tb2->owners)
>   1030					if (!sk2->sk_ipv6only)
>   1031						return true;
>   1032	
>   1033			if (tb2->addr_type != IPV6_ADDR_MAPPED)
>   1034				continue;
>   1035	#endif
>   1036			if (tb2->rcv_saddr == INADDR_ANY ||
>   1037			    tb2->rcv_saddr == sk->sk_rcv_saddr)
>   1038				return true;
>   1039		}
>   1040	
>   1041		return false;
>   1042	}
>   1043	

FYI for the reviewers -

Silly mistake. I can move the sk2 declaration inside the branch where we
walk over the v6 wildcard sockets.

Holding off for now to give people a chance to review.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ