diff options
| author | Zihan Xi <zihanx@nebusec.ai> | 2026-08-17 19:09:56 +0000 |
|---|---|---|
| committer | Steffen Klassert <steffen.klassert@secunet.com> | 2026-08-18 07:35:01 +0200 |
| commit | 4e9442ce551ebd84b52ad649df721e2dc28af95a (patch) | |
| tree | 6acd8871083151c120a76962bb1a0a59dabad8ee /tools/perf/scripts/python | |
| parent | 0fda52de8bbd4ca9a852c8a7ef6536cf82bd71fd (diff) | |
xfrm: bound nat keepalive state collection
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>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
