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: <a45ba272-685f-41dd-8582-6bbc5bc086bb@redhat.com>
Date: Thu, 21 Aug 2025 16:18:42 +0200
From: Paolo Abeni <pabeni@...hat.com>
To: Xin Long <lucien.xin@...il.com>, network dev <netdev@...r.kernel.org>
Cc: davem@...emloft.net, kuba@...nel.org, Eric Dumazet <edumazet@...gle.com>,
 Simon Horman <horms@...nel.org>, Stefan Metzmacher <metze@...ba.org>,
 Moritz Buhl <mbuhl@...nbsd.org>, Tyler Fanelli <tfanelli@...hat.com>,
 Pengtao He <hepengtao@...omi.com>, linux-cifs@...r.kernel.org,
 Steve French <smfrench@...il.com>, Namjae Jeon <linkinjeon@...nel.org>,
 Paulo Alcantara <pc@...guebit.com>, Tom Talpey <tom@...pey.com>,
 kernel-tls-handshake@...ts.linux.dev, Chuck Lever <chuck.lever@...cle.com>,
 Jeff Layton <jlayton@...nel.org>, Benjamin Coddington <bcodding@...hat.com>,
 Steve Dickson <steved@...hat.com>, Hannes Reinecke <hare@...e.de>,
 Alexander Aring <aahringo@...hat.com>, David Howells <dhowells@...hat.com>,
 Cong Wang <xiyou.wangcong@...il.com>, "D . Wythe"
 <alibuda@...ux.alibaba.com>, Jason Baron <jbaron@...mai.com>,
 illiliti <illiliti@...tonmail.com>, Sabrina Dubroca <sd@...asysnail.net>,
 Marcelo Ricardo Leitner <marcelo.leitner@...il.com>,
 Daniel Stenberg <daniel@...x.se>,
 Andy Gospodarek <andrew.gospodarek@...adcom.com>
Subject: Re: [PATCH net-next v2 08/15] quic: add path management

On 8/18/25 4:04 PM, Xin Long wrote:
> +/* Lookup a quic_udp_sock in the global hash table. If not found, creates and returns a new one
> + * associated with the given kernel socket.
> + */
> +static struct quic_udp_sock *quic_udp_sock_lookup(struct sock *sk, union quic_addr *a, u16 port)
> +{
> +	struct net *net = sock_net(sk);
> +	struct quic_hash_head *head;
> +	struct quic_udp_sock *us;
> +
> +	head = quic_udp_sock_head(net, port);
> +	hlist_for_each_entry(us, &head->head, node) {
> +		if (net != sock_net(us->sk))
> +			continue;
> +		if (a) {
> +			if (quic_cmp_sk_addr(us->sk, &us->addr, a) &&
> +			    (!us->bind_ifindex || !sk->sk_bound_dev_if ||
> +			     us->bind_ifindex == sk->sk_bound_dev_if))
> +				return us;
> +			continue;
> +		}
> +		if (ntohs(us->addr.v4.sin_port) == port)
> +			return us;
> +	}
> +	return NULL;
> +}

The function description does not match the actual function implementation.

> +
> +/* Binds a QUIC path to a local port and sets up a UDP socket. */
> +int quic_path_bind(struct sock *sk, struct quic_path_group *paths, u8 path)
> +{
> +	union quic_addr *a = quic_path_saddr(paths, path);
> +	int rover, low, high, remaining;
> +	struct net *net = sock_net(sk);
> +	struct quic_hash_head *head;
> +	struct quic_udp_sock *us;
> +	u16 port;
> +
> +	port = ntohs(a->v4.sin_port);
> +	if (port) {
> +		head = quic_udp_sock_head(net, port);
> +		mutex_lock(&head->m_lock);
> +		us = quic_udp_sock_lookup(sk, a, port);
> +		if (!quic_udp_sock_get(us)) {
> +			us = quic_udp_sock_create(sk, a);
> +			if (!us) {
> +				mutex_unlock(&head->m_lock);
> +				return -EINVAL;
> +			}
> +		}
> +		mutex_unlock(&head->m_lock);
> +
> +		quic_udp_sock_put(paths->path[path].udp_sk);
> +		paths->path[path].udp_sk = us;
> +		return 0;
> +	}
> +
> +	inet_get_local_port_range(net, &low, &high);

you could/should use inet_sk_get_local_port_range().

/P


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ