crypto: qat - clear AES key schedule from stack
Subsystems (2)
Giovanni Cabiddu
maintainerPATCH 1/1 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 <[email protected]>
Reviewed-by Ahsan Atta <[email protected]>
--- drivers/crypto/intel/qat/qat_common/qat_algs.c | 1 + 1 file changed, 1 insertion(+)
drivers/crypto/intel/qat/qat_common/qat_algs.c +1 -0
@@ -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,
base-commit: 36d82ddc0f8a88444e8d65646a3c43147005ed35
Signature · 1 line
2.54.0
Herbert Xu
maintainerQuoted 11 lines · Giovanni Cabiddu
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_ctxwithmemzero_explicit()after the copy.Fixes 5106dfeaeabe ("crypto: qat - add AES-XTS support for QAT GEN4 devices")Signed-off-by Giovanni Cabiddu <[email protected]>Reviewed-by Ahsan Atta <[email protected]>--- drivers/crypto/intel/qat/qat_common/qat_algs.c | 1 + 1 file changed, 1 insertion(+)
Patch applied. Thanks.
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt