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: <73bae72c-e706-4cb6-9836-64de560d4525@tessares.net>
Date: Wed, 16 Aug 2023 11:14:33 +0200
From: Matthieu Baerts <matthieu.baerts@...sares.net>
To: Eric Dumazet <edumazet@...gle.com>, "David S . Miller"
 <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>
Cc: Simon Horman <simon.horman@...igine.com>,
 Soheil Hassas Yeganeh <soheil@...gle.com>, netdev@...r.kernel.org,
 eric.dumazet@...il.com, Simon Horman <horms@...nel.org>,
 MPTCP Upstream <mptcp@...ts.linux.dev>
Subject: Re: [PATCH v4 net-next 05/15] inet: move inet->freebind to
 inet->inet_flags

Hi Eric,

(+ Cc MPTCP ML)

On 16/08/2023 10:15, Eric Dumazet wrote:
> IP_FREEBIND socket option can now be set/read
> without locking the socket.

Good idea, thank you for these modifications!

> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Acked-by: Soheil Hassas Yeganeh <soheil@...gle.com>
> Reviewed-by: Simon Horman <horms@...nel.org>
> ---
>  include/net/inet_sock.h  |  5 +++--
>  include/net/ipv6.h       |  3 ++-
>  net/ipv4/inet_diag.c     |  2 +-
>  net/ipv4/ip_sockglue.c   | 21 +++++++++------------
>  net/ipv6/ipv6_sockglue.c |  4 ++--

The modifications in MPTCP code...

>  net/mptcp/sockopt.c      |  7 ++++---
... looks good to me!

Reviewed-by: Matthieu Baerts <matthieu.baerts@...sares.net>

>  net/sctp/protocol.c      |  2 +-
>  7 files changed, 22 insertions(+), 22 deletions(-)

(...)

> diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
> index 21bc46acbe38ee638a2111d717b158caa317d867..ffbe2f5f5b44c3aaf588eb4b8fb3e3594bf2f71c 100644
> --- a/net/mptcp/sockopt.c
> +++ b/net/mptcp/sockopt.c
> @@ -419,7 +419,8 @@ static int mptcp_setsockopt_v6(struct mptcp_sock *msk, int optname,
>  			inet_sk(sk)->transparent = inet_sk(ssk)->transparent;
>  			break;
>  		case IPV6_FREEBIND:
> -			inet_sk(sk)->freebind = inet_sk(ssk)->freebind;
> +			inet_assign_bit(FREEBIND, sk,
> +					inet_test_bit(FREEBIND, ssk));
>  			break;
>  		}
>  
> @@ -704,7 +705,7 @@ static int mptcp_setsockopt_sol_ip_set_transparent(struct mptcp_sock *msk, int o
>  
>  	switch (optname) {
>  	case IP_FREEBIND:
> -		issk->freebind = inet_sk(sk)->freebind;
> +		inet_assign_bit(FREEBIND, ssk, inet_test_bit(FREEBIND, sk));
>  		break;
>  	case IP_TRANSPARENT:
>  		issk->transparent = inet_sk(sk)->transparent;

FYI, we are looking at simplifying this not to modify these bits
directly but rather calling tcp_setsockopt() on the different subflows,
e.g.:

https://patchwork.kernel.org/project/mptcp/patch/20230707-mptcp-unify-sockopt-issue-353-v1-5-693e15c06646@tessares.net/

But the series this patch is from is not ready yet.

> @@ -1441,7 +1442,7 @@ static void sync_socket_options(struct mptcp_sock *msk, struct sock *ssk)
>  	__tcp_sock_set_nodelay(ssk, !!msk->nodelay);
>  
>  	inet_sk(ssk)->transparent = inet_sk(sk)->transparent;
> -	inet_sk(ssk)->freebind = inet_sk(sk)->freebind;
> +	inet_assign_bit(FREEBIND, ssk, inet_test_bit(FREEBIND, sk));
>  }
>  
>  static void __mptcp_sockopt_sync(struct mptcp_sock *msk, struct sock *ssk)

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ