]> git.ipfire.org Git - thirdparty/linux.git/commit
xfrm: add state synchronization after migration
authorAntony Antony <antony.antony@secunet.com>
Tue, 26 May 2026 19:08:17 +0000 (21:08 +0200)
committerSteffen Klassert <steffen.klassert@secunet.com>
Thu, 4 Jun 2026 10:22:40 +0000 (12:22 +0200)
commitbac7a60e267831471ecdf54881fc62a2c80c446c
treee2b3a80990ade0a257f866805f07256f8a78422e
parentb2cb192b95e591b7c14af94aa0763b99149a3742
xfrm: add state synchronization after migration

Add xfrm_migrate_sync() to copy curlft and replay state from the old SA
to the new one before installation. The function allocates no memory, so
it can be called under a spinlock. In preparation for a subsequent patch
in this series.

A subsequent patch calls this under x->lock, atomically capturing the
latest lifetime counters and replay state from the original SA and
deleting it in the same critical section to prevent SN/IV reuse
for XFRM_MSG_MIGRATE_STATE method.

No functional change.

Signed-off-by: Antony Antony <antony.antony@secunet.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
include/net/xfrm.h
net/xfrm/xfrm_state.c