[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ee004a9d-7d49-448f-16d7-807afc755dd0@virtuozzo.com>
Date: Tue, 28 Feb 2023 11:54:51 +0200
From: Alexander Atanasov <alexander.atanasov@...tuozzo.com>
To: Florian Westphal <fw@...len.de>
Cc: netdev@...r.kernel.org, Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...filter.org>,
Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>
Subject: Re: [PATCH] netfilter: nf_tables: always synchronize with readers
before releasing tables
On 28.02.23 1:31, Florian Westphal wrote:
> Alexander Atanasov <alexander.atanasov@...tuozzo.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.
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?
synchronize_rcu() must be called with the commit_mutex held to be safe
against lock less readers using data protected with commit_mutext.
--
Regards,
Alexander Atanasov
Powered by blists - more mailing lists