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: <20240729155719.73646-1-kuniyu@amazon.com>
Date: Mon, 29 Jul 2024 08:57:19 -0700
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: <xiaolinkui@....com>
CC: <davem@...emloft.net>, <dsahern@...nel.org>, <edumazet@...gle.com>,
	<kuba@...nel.org>, <netdev@...r.kernel.org>, <pabeni@...hat.com>,
	<xiaolinkui@...inos.cn>
Subject: Re: [PATCH] tcp/dccp: Add another way to allocate local ports in connect()

From: xiaolinkui@....com
Date: Mon, 29 Jul 2024 17:55:54 +0800
> From: Linkui Xiao <xiaolinkui@...inos.cn>
> 
> Commit 07f4c90062f8 ("tcp/dccp: try to not exhaust ip_local_port_range
> in connect()") allocates even ports for connect() first while leaving
> odd ports for bind() and this works well in busy servers.
> 
> But this strategy causes severe performance degradation in busy clients.
> when a client has used more than half of the local ports setted in
> proc/sys/net/ipv4/ip_local_port_range, if this client try to connect
> to a server again, the connect time increases rapidly since it will
> traverse all the even ports though they are exhausted.
> 
> So this path provides another strategy by introducing a system option:
> local_port_allocation. If it is a busy client, users should set it to 1
> to use sequential allocation while it should be set to 0 in other
> situations. Its default value is 0.
> 
> In commit 207184853dbd ("tcp/dccp: change source port selection at
> connect() time"), tell users that they can access all odd and even ports
> by using IP_LOCAL_PORT_RANGE. But this requires users to modify the
> socket application.

The application should be changed, or probably you can put your application
into a cgroup and hook connect() to call bpf_setsockopt() and silently
enable IP_LOCAL_PORT_RANGE.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ