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_dWdj5WNWZ82WWCwie6SWidKoWzqWEpzLinm-186x6Tbw@mail.gmail.com>
Date: Fri, 24 Oct 2025 10:12:28 -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 3/8] sctp: Don't call sk->sk_prot->init() in sctp_v[46]_create_accept_sk().

On Thu, Oct 23, 2025 at 7:17 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_v[46]_create_accept_sk() calls sctp_init_sock() to initialise
> sctp_sock, but most fields are overwritten by sctp_copy_descendant()
> called from sctp_sock_migrate().
>
> Things done in sctp_init_sock() but not in sctp_sock_migrate() are
> the following:
>
>   1. Copy sk->sk_gso
>   2. Copy sk->sk_destruct (sctp_v6_init_sock())
>   3. Allocate sctp_sock.ep
>   4. Initialise sctp_sock.pd_lobby
>   5. Count sk_sockets_allocated_inc(), sock_prot_inuse_add(),
>      and SCTP_DBG_OBJCNT_INC()
>
> Let's do these in sctp_copy_sock() and sctp_sock_migrate() and avoid
> calling sk->sk_prot->init() in sctp_v[46]_create_accept_sk().
>
> Note that sk->sk_destruct is already copied in sctp_copy_sock().
>
> Signed-off-by: Kuniyuki Iwashima <kuniyu@...gle.com>
Acked-by: Xin Long <lucien.xin@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ