All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Simon Horman <horms@kernel.org>,
	stefan.wiehler@nokia.com
Subject: Re: [PATCH v2 net 1/3] ipmr: add debug check for mr table cleanup
Date: Tue, 26 Nov 2024 08:34:34 -0700	[thread overview]
Message-ID: <ecc5c683-0331-42a8-9061-3a4eef96e5bb@kernel.org> (raw)
In-Reply-To: <64f267b5c0dd74f5bc8795b4ff868b5b103741da.1732289799.git.pabeni@redhat.com>

On 11/24/24 8:40 AM, Paolo Abeni wrote:
> The multicast route tables lifecycle, for both ipv4 and ipv6, is
> protected by RCU using the RTNL lock for write access. In many
> places a table pointer escapes the RCU (or RTNL) protected critical
> section, but such scenarios are actually safe because tables are
> deleted only at namespace cleanup time or just after allocation, in
> case of default rule creation failure.
> 
> Tables freed at namespace cleanup time are assured to be alive for the
> whole netns lifetime; tables freed just after creation time are never
> exposed to other possible users.
> 
> Ensure that the free conditions are respected in ip{,6}mr_free_table, to
> document the locking schema and to prevent future possible introduction
> of 'table del' operation from breaking it.
> 
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
> v1 -> v2:
>  - fix build errors with CONFIG_IP{,V6}_MROUTE_MULTIPLE_TABLES=n
> ---
>  net/ipv4/ipmr.c  | 14 ++++++++++++++
>  net/ipv6/ip6mr.c | 14 ++++++++++++++
>  2 files changed, 28 insertions(+)
> 

Reviewed-by: David Ahern <dsahern@kernel.org>



  reply	other threads:[~2024-11-26 15:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-24 15:40 [PATCH v2 net 0/3] net: fix mcast RCU splats Paolo Abeni
2024-11-24 15:40 ` [PATCH v2 net 1/3] ipmr: add debug check for mr table cleanup Paolo Abeni
2024-11-26 15:34   ` David Ahern [this message]
2024-11-24 15:40 ` [PATCH v2 net 2/3] ip6mr: fix tables suspicious RCU usage Paolo Abeni
2024-11-26 15:39   ` David Ahern
2024-11-24 15:40 ` [PATCH v2 net 3/3] ipmr: " Paolo Abeni
2024-11-26 15:40   ` David Ahern
2024-11-28  9:30 ` [PATCH v2 net 0/3] net: fix mcast RCU splats patchwork-bot+netdevbpf

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=ecc5c683-0331-42a8-9061-3a4eef96e5bb@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stefan.wiehler@nokia.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.