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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 25 Jan 2012 19:47:35 +0100
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Flavio Leitner <fbl@...hat.com>
Cc:	netdev <netdev@...r.kernel.org>,
	Marcelo Leitner <mleitner@...hat.com>
Subject: Re: [PATCH 1/2] tcp: bind() fix autoselection to share ports

Le mercredi 25 janvier 2012 à 16:34 -0200, Flavio Leitner a écrit :
> The current code checks for conflicts when the application
> requests a specific port.  If there is no conflict, then
> the request is granted.
> 
> On the other hand, the port autoselection done by the kernel
> fails when all ports are bound even when there is a port
> with no conflict available.
> 
> The fix changes port autoselection to check if there is a
> conflict and use it if not.
> 
> Signed-off-by: Flavio Leitner <fbl@...hat.com>
> ---
>  net/ipv4/inet_connection_sock.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
> index 2e4e244..ecd19b5 100644
> --- a/net/ipv4/inet_connection_sock.c
> +++ b/net/ipv4/inet_connection_sock.c
> @@ -128,6 +128,11 @@ again:
>  							goto have_snum;
>  						}
>  					}
> +					if (!inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) {
> +						spin_unlock(&head->lock);
> +						snum = rover;
> +						goto have_snum;
> +					}
>  					goto next;
>  				}
>  			break;



Acked-by: Eric Dumazet <eric.dumazet@...il.com>


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