linux-sctp.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
To: Or Cohen <orcohen@paloaltonetworks.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	vyasevich@gmail.com, nhorman@tuxdriver.com, davem@davemloft.net,
	kuba@kernel.org, linux-sctp@vger.kernel.org,
	lucien.xin@gmail.com, nmarkus@paloaltonetworks.com
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: <20210413093153.27281-1-orcohen@paloaltonetworks.com>

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.

  Marcelo

      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 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* 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 \
    --to=marcelo.leitner@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sctp@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=nmarkus@paloaltonetworks.com \
    --cc=orcohen@paloaltonetworks.com \
    --cc=vyasevich@gmail.com \
    --subject='Re: [PATCH] net/sctp: fix race condition in sctp_destroy_sock' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).