All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jakub Sitnicki <jakub@cloudflare.com>
Cc: netdev@vger.kernel.org, kernel-team@cloudflare.com,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Haowei Yan <g1042620637@gmail.com>,
	Tom Parkin <tparkin@katalix.com>
Subject: Re: [PATCH net v2] l2tp: Serialize access to sk_user_data with sock lock
Date: Tue, 16 Aug 2022 18:41:50 -0700	[thread overview]
Message-ID: <20220816184150.78d6e3e3@kernel.org> (raw)
In-Reply-To: <20220815130107.149345-1-jakub@cloudflare.com>

On Mon, 15 Aug 2022 15:01:07 +0200 Jakub Sitnicki wrote:
> sk->sk_user_data has multiple users, which are not compatible with each
> other. To synchronize the users, any check-if-unused-and-set access to the
> pointer has to happen with sock lock held.
> 
> l2tp currently fails to grab the lock when modifying the underlying tunnel
> socket. Fix it by adding appropriate locking.
> 
> We don't to grab the lock when l2tp clears sk_user_data, because it happens
> only in sk->sk_destruct, when the sock is going away.

Note to other netdev maintainers that based on the discussion about 
the reuseport locking it's unclear whether we shouldn't also take 
the callback lock...

  parent reply	other threads:[~2022-08-17  1:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 13:01 [PATCH net v2] l2tp: Serialize access to sk_user_data with sock lock Jakub Sitnicki
2022-08-15 13:21 ` Tom Parkin
2022-08-15 13:26   ` Jakub Sitnicki
2022-08-15 13:39     ` Tom Parkin
2022-08-17  1:41 ` Jakub Kicinski [this message]
2022-08-17 14:33   ` Jakub Sitnicki
2022-08-17 15:51     ` Jakub Kicinski
2022-08-17 15:56       ` Jakub Sitnicki

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=20220816184150.78d6e3e3@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=g1042620637@gmail.com \
    --cc=jakub@cloudflare.com \
    --cc=kernel-team@cloudflare.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tparkin@katalix.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.