[PATCH v2 2/2] s390/crypto: Explicit scrub temp buffer in PAES ctr mode algorithm
Harald Freudenberger <[email protected]> Wed, 5 Aug 2026 17:54:58 +0200
| Newsgroups | org.kernel.vger.linux-crypto,org.kernel.vger.linux-s390 |
|---|---|
| Message-ID | <[email protected]> |
In function ctr_paes_do_crypt() there is a buffer used to process
remaining bytes < AES_BLOCK_SIZE. This buffer was not scrubbed and
thus could lead to expose of unwanted data.
On exit of the function unconditionally scrub this buffer to avoid
exposure of maybe sensitive data.
Fixes: 6cd87cb5ef6c ("s390/crypto: Rework protected key AES for true asynch support")
Signed-off-by: Harald Freudenberger <[email protected]>
Cc: [email protected] # 6.16+
---
arch/s390/crypto/paes_s390.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/s390/crypto/paes_s390.c b/arch/s390/crypto/paes_s390.c
index 89785ab95e6b..c95cc80b4205 100644
--- a/arch/s390/crypto/paes_s390.c
+++ b/arch/s390/crypto/paes_s390.c
@@ -1026,6 +1026,7 @@ static int ctr_paes_do_crypt(struct s390_paes_ctx *ctx,
}
out:
+ memzero_explicit(buf, sizeof(buf));
pr_debug("rc=%d\n", rc);
return rc;
}
--
2.43.0