]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
crypto: authencesn - Fix src offset when decrypting in-place
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 30 Apr 2026 06:27:29 +0000 (23:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2026 09:19:11 +0000 (11:19 +0200)
commit 1f48ad3b19a9dfc947868edda0bb8e48e5b5a8fa upstream.

The src SG list offset wasn't set properly when decrypting in-place,
fix it.

Reported-by: Wolfgang Walter <linux@stwm.de>
Fixes: e02494114ebf ("crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
crypto/authencesn.c

index 5dc057cb0cdf1414e1bcb04ca53aca5ddba14b20..2154d4ab5c9522d0b203194b1fd92939145a328a 100644 (file)
@@ -235,9 +235,11 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
 
 decrypt:
 
-       if (src != dst)
-               src = scatterwalk_ffwd(areq_ctx->src, src, assoclen);
        dst = scatterwalk_ffwd(areq_ctx->dst, dst, assoclen);
+       if (req->src == req->dst)
+               src = dst;
+       else
+               src = scatterwalk_ffwd(areq_ctx->src, src, assoclen);
 
        skcipher_request_set_tfm(skreq, ctx->enc);
        skcipher_request_set_callback(skreq, flags,