All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet at gmail.com>
To: mptcp at lists.01.org
Subject: [MPTCP] Re: [PATCH net] inet_connection_sock: clear inet_num out of destroy helper
Date: Thu, 04 Jun 2020 10:43:52 -0700	[thread overview]
Message-ID: <5b3af1f4-c1f4-5f60-21e0-9b52f186f328@gmail.com> (raw)
In-Reply-To: cc2adbd7dcc17c44e2858e550302906760b38a0b.1591289527.git.pabeni@redhat.com

[-- Attachment #1: Type: text/plain, Size: 833 bytes --]



On 6/4/20 9:55 AM, Paolo Abeni wrote:
> Clearing the 'inet_num' field is necessary and safe if and
> only if the socket is not bound. The MPTCP protocol calls
> the destroy helper on bound sockets, as tcp_v{4,6}_syn_recv_sock
> completed successfully.
> 
> Move the clearing of such field out of the common code, otherwise
> the MPTCP MP_JOIN error path will find the wrong 'inet_num' value
> on socket disposal, __inet_put_port() will acquire the wrong lock
> and bind_node removal could race with other modifiers possibly
> corrupting the bind hash table.
> 
> Reported-and-tested-by: Christoph Paasch <cpaasch(a)apple.com>
> Fixes: 729cd6436f35 ("mptcp: cope better with MP_JOIN failure")
> Signed-off-by: Paolo Abeni <pabeni(a)redhat.com>
> ---

Reviewed-by: Eric Dumazet <edumazet(a)google.com>

Thanks.

WARNING: multiple messages have this Message-ID (diff)
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: Mat Martineau <mathew.j.martineau@linux.intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	mptcp@lists.01.org, Eric Dumazet <edumazet@google.com>,
	Christoph Paasch <cpaasch@apple.com>
Subject: Re: [PATCH net] inet_connection_sock: clear inet_num out of destroy helper
Date: Thu, 4 Jun 2020 10:43:52 -0700	[thread overview]
Message-ID: <5b3af1f4-c1f4-5f60-21e0-9b52f186f328@gmail.com> (raw)
In-Reply-To: <cc2adbd7dcc17c44e2858e550302906760b38a0b.1591289527.git.pabeni@redhat.com>



On 6/4/20 9:55 AM, Paolo Abeni wrote:
> Clearing the 'inet_num' field is necessary and safe if and
> only if the socket is not bound. The MPTCP protocol calls
> the destroy helper on bound sockets, as tcp_v{4,6}_syn_recv_sock
> completed successfully.
> 
> Move the clearing of such field out of the common code, otherwise
> the MPTCP MP_JOIN error path will find the wrong 'inet_num' value
> on socket disposal, __inet_put_port() will acquire the wrong lock
> and bind_node removal could race with other modifiers possibly
> corrupting the bind hash table.
> 
> Reported-and-tested-by: Christoph Paasch <cpaasch@apple.com>
> Fixes: 729cd6436f35 ("mptcp: cope better with MP_JOIN failure")
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---

Reviewed-by: Eric Dumazet <edumazet@google.com>

Thanks.


             reply	other threads:[~2020-06-04 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 17:43 Eric Dumazet [this message]
2020-06-04 17:43 ` [PATCH net] inet_connection_sock: clear inet_num out of destroy helper Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2020-06-04 23:00 [MPTCP] " David Miller
2020-06-04 23:00 ` David Miller
2020-06-04 16:55 [MPTCP] " Paolo Abeni
2020-06-04 16:55 ` Paolo Abeni

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=5b3af1f4-c1f4-5f60-21e0-9b52f186f328@gmail.com \
    --to=unknown@example.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.