netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Alexander Atanasov <alexander.atanasov@virtuozzo.com>
Cc: Florian Westphal <fw@strlen.de>,
	netdev@vger.kernel.org, Pablo Neira Ayuso <pablo@netfilter.org>,
	Jozsef Kadlecsik <kadlec@netfilter.org>,
	Eric Dumazet <edumazet@google.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH] netfilter: nf_tables: always synchronize with readers before releasing tables
Date: Tue, 28 Feb 2023 11:59:29 +0100	[thread overview]
Message-ID: <20230228105929.GB6107@breakpoint.cc> (raw)
In-Reply-To: <ee004a9d-7d49-448f-16d7-807afc755dd0@virtuozzo.com>

Alexander Atanasov <alexander.atanasov@virtuozzo.com> wrote:
> On 28.02.23 1:31, Florian Westphal wrote:
> > Alexander Atanasov <alexander.atanasov@virtuozzo.com> wrote:
> > > As i said i am still trying to figure out the basechain place,
> > > where is that synchronize_rcu() call done?
> > 
> > cleanup_net() in net/core/net_namespace.c.
> > 
> > pre_exit handlers run, then synchronize_rcu, then the
> > normal exit handlers, then exit_batch.
> 
> It prevents anyone new to find the namespace but it does not guard against
> the ones that have already found it.

The netns is being dismantled, how can there be any process left?

> What stops them to enter a rcu_read_lock() section after the synchronize
> call in cleanup_net() is done and race with the exit handler?

There should be no task in the first place.

> synchronize_rcu() must be called with the commit_mutex held to be safe
> against lock less readers using data protected with commit_mutext.

Sorry, I do not understand this bug nor the fix.

      reply	other threads:[~2023-02-28 10:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230227121720.3775652-1-alexander.atanasov@virtuozzo.com>
2023-02-27 12:21 ` [PATCH] netfilter: nf_tables: always synchronize with readers before releasing tables Alexander Atanasov
2023-02-27 12:44   ` Florian Westphal
2023-02-27 13:43     ` Alexander Atanasov
     [not found]       ` <20230227161140.GA31439@breakpoint.cc>
2023-02-27 18:50         ` Alexander Atanasov
2023-02-27 23:31           ` Florian Westphal
2023-02-28  9:54             ` Alexander Atanasov
2023-02-28 10:59               ` Florian Westphal [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=20230228105929.GB6107@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=alexander.atanasov@virtuozzo.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    /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 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).