The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Steffen Klassert <steffen.klassert@secunet.com>
To: Zihan Xi <zihanx@nebusec.ai>
Cc: <netdev@vger.kernel.org>, <herbert@gondor.apana.org.au>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <horms@kernel.org>,
	<linux-kernel@vger.kernel.org>, <stable@vger.kernel.org>,
	Eyal Birger <eyal.birger@gmail.com>, Vega <vega@nebusec.ai>
Subject: Re: [PATCH ipsec v3 1/1] xfrm: bound nat keepalive state collection
Date: Tue, 18 Aug 2026 10:49:29 +0200	[thread overview]
Message-ID: <aoQcmVtl0RLmtd3u@secunet.com> (raw)
In-Reply-To: <4fadde7d28791a4e1196664cec692fdebce99bb5.1786987905.git.zihanx@nebusec.ai>

On Mon, Aug 17, 2026 at 07:09:56PM +0000, Zihan Xi wrote:
> The v1 nat keepalive fix allocates a GFP_ATOMIC object for every state
> while collecting references for phase two. This makes the worker's
> temporary memory use depend on the number of states and lets -ENOMEM abort
> the scan.
> 
> Replace the allocated list with a fixed-size batch. When the batch is full,
> return a private walk status so xfrm_state_walk() leaves a cursor; drain
> the references after the walk releases xfrm_state_lock and resume from
> the cursor. This bounds temporary memory use and avoids the allocation
> failure path.
> 
> The v1 fix also moved nat_keepalive_send() out of the walk callback. Keep
> the phase-two drain BH-disabled, as required by local_lock_nested_bh()
> used by the keepalive sockets.
> 
> Fixes: 763fe700b7c5 ("xfrm: avoid lock inversion in nat keepalive work")
> Cc: stable@vger.kernel.org
> Cc: Eyal Birger <eyal.birger@gmail.com>
> Reported-by: Vega <vega@nebusec.ai>
> Assisted-by: Codex:gpt-5.4
> Signed-off-by: Zihan Xi <zihanx@nebusec.ai>

Applied, thanks a lot!

      reply	other threads:[~2026-08-18  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 19:01 [PATCH ipsec v3 0/1] xfrm: bound nat keepalive state collection Zihan Xi
2026-08-17 19:09 ` [PATCH ipsec v3 1/1] " Zihan Xi
2026-08-18  8:49   ` 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=aoQcmVtl0RLmtd3u@secunet.com \
    --to=steffen.klassert@secunet.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eyal.birger@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=stable@vger.kernel.org \
    --cc=vega@nebusec.ai \
    --cc=zihanx@nebusec.ai \
    /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