From: Herbert Xu Date: Thu, 30 Apr 2026 06:27:29 +0000 (-0700) Subject: crypto: authencesn - Fix src offset when decrypting in-place X-Git-Tag: v6.1.170~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b5ac2c209ec71df33bdc9eb7b4c22a833d18faae;p=thirdparty%2Fkernel%2Fstable.git crypto: authencesn - Fix src offset when decrypting in-place commit 1f48ad3b19a9dfc947868edda0bb8e48e5b5a8fa upstream. The src SG list offset wasn't set properly when decrypting in-place, fix it. Reported-by: Wolfgang Walter Fixes: e02494114ebf ("crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption") Signed-off-by: Herbert Xu Signed-off-by: Eric Biggers Signed-off-by: Greg Kroah-Hartman --- diff --git a/crypto/authencesn.c b/crypto/authencesn.c index 5dc057cb0cdf1..2154d4ab5c952 100644 --- a/crypto/authencesn.c +++ b/crypto/authencesn.c @@ -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,