Skip to contentSkip to conversation

xfrm: fix xfrm_do_migrate() with AEAD e.g(AES-GCM)

PATCH In review Antony Antony 2 participants 2 messages Dec 7, 2017 – Dec 8, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfrm: fix xfrm_do_migrate() with AEAD e.g(AES-GCM)

copy geniv when cloning the xfrm state.

x->geniv was not copied to the new state and migration would fail.

xfrm_do_migrate
..
xfrm_state_clone()
..
..
esp_init_aead()
crypto_alloc_aead()
crypto_alloc_tfm()
crypto_find_alg() return EAGAIN and failed

---
 net/xfrm/xfrm_state.c | 1 +
 1 file changed, 1 insertion(+)
net/xfrm/xfrm_state.c +1 -0
index 065d89606888..500b3391f474 100644
@@ -1343,6 +1343,7 @@ static struct xfrm_state *xfrm_state_clone(struct xfrm_state *orig,
 
 	if (orig->aead) {
 		x->aead = xfrm_algo_aead_clone(orig->aead);
+		x->geniv = orig->geniv;
 		if (!x->aead)
 			goto error;
 	}
Signature · 1 line
2.13.6
maintainer
#1 lore raw
Quoted 14 lines · Antony Antony

copy geniv when cloning the xfrm state.

x->geniv was not copied to the new state and migration would fail.

xfrm_do_migrate
..
xfrm_state_clone()
..
..
esp_init_aead()
crypto_alloc_aead()
crypto_alloc_tfm()
crypto_find_alg() return EAGAIN and failed

Quoted 1 line

Patch applied, thanks Antony!