🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Steffen Klassert Tue, 01 Dec 2026 06:34
Re: [PATCH ipsec 0/4] xfrm: Fix device state teardown races
#24995
Author: Steffen Klassert
Date: Tue, 01 Dec 2026 06:34
40 lines
10990 bytes
On Wed, Nov 25, 2026 at 03:34:08AM +0200, Jianbo Liu wrote:
> Three fixes for the teardown of xfrm device offload state and one
> revert, for ipsec.
> 
> xfrm_dev_state_free() runs for the same state from the state GC, from
> the device flush and from xfrm_state_find(). Commit 89fefad9f971
> ("xfrm: serialize state GC with device state flush") serializes the
> first two with a mutex, but xfrm_state_find() runs under RCU and
> still races with the flush.
> 
> Let only one caller free the device state of an SA, hold a state
> reference in the flush and wait for an RCU grace period before the
> free. The mutex is not needed after that, so revert that commit.
> 
> 1. xfrm: Give GC list nodes their own storage
>    Stop sharing the GC list nodes with the bydst and bysrc hash nodes.
>    Patch 2 uses gclist on states that RCU readers may still walk.
> 
> 2. xfrm: Serialize device state teardown
>    Let only one caller free the device state of an SA.
> 
> 3. xfrm: Wait for an RCU grace period before freeing device state
>    Let RCU readers of the driver state finish before the free.
> 
> 4. Revert "xfrm: serialize state GC with device state flush"
>    Remove the mutex that the fixes above make redundant.
> 
> Jianbo Liu (4):
>   xfrm: Give GC list nodes their own storage
>   xfrm: Serialize device state teardown
>   xfrm: Wait for an RCU grace period before freeing device state
>   Revert "xfrm: serialize state GC with device state flush"
> 
>  include/net/xfrm.h     | 10 +++----
>  net/xfrm/xfrm_device.c |  4 +--
>  net/xfrm/xfrm_state.c  | 61 ++++++++++++++++++++++++++----------------
>  3 files changed, 44 insertions(+), 31 deletions(-)

Series applied, thanks a lot Jianbo!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads