All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Cen Zhang <zzzccc427@gmail.com>
Cc: <herbert@gondor.apana.org.au>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<horms@kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <baijiaju1990@gmail.com>,
	<jjzuming@gmail.com>
Subject: Re: [PATCH ipsec 0/2] xfrm: fix state lifetimes in xfrm_migrate()
Date: Wed, 11 Nov 2026 10:09:32 +0100	[thread overview]
Message-ID: <avQwzAEyN98FXtCP@gauss4> (raw)
In-Reply-To: <pm-xfrm-core-objects-candidate-0027-v3-cb1e033bff1976f510c9-0@gmail.com>

On Sat, Oct 31, 2026 at 12:14:53PM +0800, Cen Zhang wrote:
> xfrm_migrate() keeps the old states in x_cur[] and their successors in
> x_new[], but it does not hold a reference to every state it later
> deletes. An SA with a hard lifetime can expire and be freed by the timer
> and the state GC in that window, and the following xfrm_state_delete()
> takes the lock of freed memory:
> 
>   1/2 The success path drops the lookup references of the old states
>       before it deletes them. Delete them first.
> 
>   2/2 xfrm_state_migrate() returns the published successor without a
>       caller reference, so the rollback deletes states it does not
>       hold. Take that reference before publishing and drop it after the
>       migration commits or rolls back.
> 
> Both windows date back to the initial migration support and are reached
> by XFRM_MSG_MIGRATE and PF_KEY's SADB_X_MIGRATE.
> 
> Cen Zhang (2):
>   xfrm: keep old state references until migration deletion completes
>   xfrm: hold migrated states through rollback

Series applied, thanks a lot!

      parent reply	other threads:[~2026-11-11  9:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-31  4:14 [PATCH ipsec 0/2] xfrm: fix state lifetimes in xfrm_migrate() Cen Zhang
2026-10-31  4:14 ` [PATCH ipsec 1/2] xfrm: keep old state references until migration deletion completes Cen Zhang
2026-10-31  4:14 ` [PATCH ipsec 2/2] xfrm: hold migrated states through rollback Cen Zhang
2026-10-31  4:18 ` [PATCH ipsec 0/2] xfrm: fix state lifetimes in xfrm_migrate() netdev-bot+sinfo
2026-11-11  9:09 ` 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=avQwzAEyN98FXtCP@gauss4 \
    --to=steffen.klassert@secunet.com \
    --cc=baijiaju1990@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=jjzuming@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=zzzccc427@gmail.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.