]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfrm: call xfrm_dev_state_delete when xfrm_state_migrate fails to add the state
authorSabrina Dubroca <sd@queasysnail.net>
Thu, 16 Oct 2025 10:39:15 +0000 (12:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Dec 2025 10:45:49 +0000 (11:45 +0100)
commit06ccae7bace4de422ea399acec9e7f213d79e14b
tree952df3b9ac71f499470dc36ac8daeda34ae242fd
parentd6fe5c740c573af10943b8353992e1325cdb2715
xfrm: call xfrm_dev_state_delete when xfrm_state_migrate fails to add the state

[ Upstream commit 7f02285764790e0ff1a731b4187fa3e389ed02c7 ]

In case xfrm_state_migrate fails after calling xfrm_dev_state_add, we
directly release the last reference and destroy the new state, without
calling xfrm_dev_state_delete (this only happens in
__xfrm_state_delete, which we're not calling on this path, since the
state was never added).

Call xfrm_dev_state_delete on error when an offload configuration was
provided.

Fixes: ab244a394c7f ("xfrm: Migrate offload configuration")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/xfrm/xfrm_state.c