]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfrm: call xdo_dev_state_delete during state update
authorSabrina Dubroca <sd@queasysnail.net>
Mon, 23 Feb 2026 23:05:13 +0000 (00:05 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Wed, 25 Feb 2026 08:11:33 +0000 (09:11 +0100)
When we update an SA, we construct a new state and call
xdo_dev_state_add, but never insert it. The existing state is updated,
then we immediately destroy the new state. Since we haven't added it,
we don't go through the standard state delete code, and we're skipping
removing it from the device (but xdo_dev_state_free will get called
when we destroy the temporary state).

This is similar to commit c5d4d7d83165 ("xfrm: Fix deletion of
offloaded SAs on failure.").

Fixes: d77e38e612a0 ("xfrm: Add an IPsec hardware offloading API")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_state.c

index 98b362d518363bbc100b5446d6a327b3209fed99..a00c4fe1ab0ce28baae04ca95fcc17b55e590156 100644 (file)
@@ -2264,6 +2264,7 @@ out:
 
                err = 0;
                x->km.state = XFRM_STATE_DEAD;
+               xfrm_dev_state_delete(x);
                __xfrm_state_put(x);
        }