archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <>
To: Or Cohen <>
Subject: Re: [PATCH] net/sctp: fix race condition in sctp_destroy_sock
Date: Tue, 13 Apr 2021 12:20:47 -0300	[thread overview]
Message-ID: <YHW2zwdoDLVRPB/6@horizon.localdomain> (raw)
In-Reply-To: <>

On Tue, Apr 13, 2021 at 12:31:53PM +0300, Or Cohen wrote:
> +++ b/net/sctp/socket.c
> @@ -1520,11 +1520,9 @@ static void sctp_close(struct sock *sk, long timeout)
>  	/* Supposedly, no process has access to the socket, but
>  	 * the net layers still may.
> -	 * Also, sctp_destroy_sock() needs to be called with addr_wq_lock
> -	 * held and that should be grabbed before socket lock.
>  	 */

Please also update the following comment in sctp_init_sock():
          /* Nothing can fail after this block, otherwise
           * sctp_destroy_sock() will be called without addr_wq_lock held

Other than this, LGTM. Thanks.


      reply	other threads:[~2021-04-13 15:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13  9:31 [PATCH] net/sctp: fix race condition in sctp_destroy_sock Or Cohen
2021-04-13 15:20 ` Marcelo Ricardo Leitner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHW2zwdoDLVRPB/6@horizon.localdomain \ \ \ \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).