summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGiovanni Cabiddu <giovanni.cabiddu@intel.com>2026-06-08 16:04:20 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2026-07-05 13:19:52 +0800
commitd41a9fcfb7f9ee36e4a4aaf5e7996bca6be1e7a9 (patch)
treee295eb9dfdd4b5fc5ad3b3dbc066a59999da25e1 /drivers
parent455b0f3ac9e254edab9f5a873d337abe5e6e3604 (diff)
downloadlinux-next-d41a9fcfb7f9ee36e4a4aaf5e7996bca6be1e7a9.tar.gz
linux-next-d41a9fcfb7f9ee36e4a4aaf5e7996bca6be1e7a9.zip
crypto: qat - clear AES key schedule from stack
qat_alg_xts_reverse_key() expands the forward XTS AES key on the stack. That schedule contains key material and can remain in the stack frame. Clear the temporary crypto_aes_ctx with memzero_explicit() after the copy. Fixes: 5106dfeaeabe ("crypto: qat - add AES-XTS support for QAT GEN4 devices") Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Reviewed-by: Ahsan Atta <ahsan.atta@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/crypto/intel/qat/qat_common/qat_algs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/intel/qat/qat_common/qat_algs.c b/drivers/crypto/intel/qat/qat_common/qat_algs.c
index 7f638a62e3ad..91663805d9e6 100644
--- a/drivers/crypto/intel/qat/qat_common/qat_algs.c
+++ b/drivers/crypto/intel/qat/qat_common/qat_algs.c
@@ -405,6 +405,7 @@ static void qat_alg_xts_reverse_key(const u8 *key_forward, unsigned int keylen,
memcpy(key_reverse + AES_BLOCK_SIZE, key - AES_BLOCK_SIZE,
AES_BLOCK_SIZE);
}
+ memzero_explicit(&aes_expanded, sizeof(aes_expanded));
}
static void qat_alg_skcipher_init_dec(struct qat_alg_skcipher_ctx *ctx,