]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: authencesn - Fix src offset when decrypting in-place
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Apr 2026 23:39:06 +0000 (07:39 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 16 Apr 2026 09:29:40 +0000 (17:29 +0800)
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>
crypto/authencesn.c

index c0a01d738d9bc3922b35e23231edcb4e9a7921f9..af3d584e584fbc9383afa35dd9d748953f3b99ac 100644 (file)
@@ -228,9 +228,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,