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: <CADvbK_fnzXPNiLTQ9fV0P8ZYaw1au8iwMoijsmgHmcGbyS=0dg@mail.gmail.com>
Date: Fri, 24 Oct 2025 10:51:55 -0400
From: Xin Long <lucien.xin@...il.com>
To: Kuniyuki Iwashima <kuniyu@...gle.com>
Cc: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>, "David S. Miller" <davem@...emloft.net>, 
	Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, 
	Simon Horman <horms@...nel.org>, Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org, 
	linux-sctp@...r.kernel.org
Subject: Re: [PATCH v3 net-next 5/8] sctp: Use sk_clone() in sctp_accept().

On Thu, Oct 23, 2025 at 7:18 PM Kuniyuki Iwashima <kuniyu@...gle.com> wrote:
>
> sctp_accept() calls sctp_v[46]_create_accept_sk() to allocate a new
> socket and calls sctp_sock_migrate() to copy fields from the parent
> socket to the new socket.
>
> sctp_v4_create_accept_sk() allocates sk by sk_alloc(), initialises
> it by sock_init_data(), and copy a bunch of fields from the parent
> socekt by sctp_copy_sock().
>
> sctp_sock_migrate() calls sctp_copy_descendant() to copy most fields
> in sctp_sock from the parent socket by memcpy().
>
> These can be simply replaced by sk_clone().
>
> Let's consolidate sctp_v[46]_create_accept_sk() to sctp_clone_sock()
> with sk_clone().
>
> We will reuse sctp_clone_sock() for sctp_do_peeloff() and then remove
> sctp_copy_descendant().
>
> Note that sock_reset_flag(newsk, SOCK_ZAPPED) is not copied to
> sctp_clone_sock() as sctp does not use SOCK_ZAPPED at all.
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
Nice patch for the dup sk copy code cleanup. Thanks.

Acked-by: Xin Long <lucien.xin@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ