public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Florian Westphal <fw@strlen.de>
Cc: <netdev@vger.kernel.org>
Subject: Re: [PATCH ipsec 1/2] xfrm: Wait for RCU readers during policy netns exit
Date: Tue, 7 Apr 2026 10:16:52 +0200	[thread overview]
Message-ID: <adS9dNSsPmjgyh9s@secunet.com> (raw)
In-Reply-To: <ac5YaN5EJQwokOq6@strlen.de>

On Thu, Apr 02, 2026 at 01:52:08PM +0200, Florian Westphal wrote:
> Steffen Klassert <steffen.klassert@secunet.com> wrote:
> > xfrm_policy_fini() frees the policy_bydst hash tables after flushing the
> > policy work items and deleting all policies, but it does not wait for
> > concurrent RCU readers to leave their read-side critical sections first.
> > 
> > The policy_bydst tables are published via rcu_assign_pointer() and are
> > looked up through rcu_dereference_check(), so netns teardown must also
> > wait for an RCU grace period before freeing the table memory.
> > 
> > Fix this by adding synchronize_rcu() before freeing the policy hash tables.
> > 
> > Fixes: e1e551bc5630 ("xfrm: policy: prepare policy_bydst hash for rcu lookups")
> 
> Reviewed-by: Florian Westphal <fw@strlen.de>

This is now applied to the ipsec tree.

      reply	other threads:[~2026-04-07  8:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-02 11:31 [PATCH ipsec 1/2] xfrm: Wait for RCU readers during policy netns exit Steffen Klassert
2026-04-02 11:31 ` [PATCH ipsec 2/2] xfrm: Wait for RCU readers during state " Steffen Klassert
2026-04-02 11:57   ` Florian Westphal
2026-04-02 12:06     ` Steffen Klassert
2026-04-02 11:52 ` [PATCH ipsec 1/2] xfrm: Wait for RCU readers during policy " Florian Westphal
2026-04-07  8:16   ` Steffen Klassert [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=adS9dNSsPmjgyh9s@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.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