From dadc0c1bbccad48022e400debc3341597a0f2cf5 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Thu, 30 Apr 2026 19:56:24 +0800 Subject: [PATCH] crypto: authencesn - Fix src offset when decrypting in-place JIRA: https://redhat.atlassian.net/browse/RHEL-172216 Upstream Status: 1f48ad3b19a9dfc947868edda0bb8e48e5b5a8fa commit 1f48ad3b19a9dfc947868edda0bb8e48e5b5a8fa Author: Herbert Xu Date: Wed Apr 15 07:39:06 2026 +0800 crypto: authencesn - Fix src offset when decrypting in-place 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: Herbert Xu diff --git a/crypto/authencesn.c b/crypto/authencesn.c index b262e7e3f8d7..d96da934674e 100644 --- a/crypto/authencesn.c +++ b/crypto/authencesn.c @@ -259,9 +259,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, -- 2.50.1 (Apple Git-155)