diff options
author | Arvind Sankar <nivedita@alum.mit.edu> | 2020-10-25 17:31:15 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-10-30 09:35:03 +0300 |
commit | 458c0480dcb338d7b72e89b2e88a622965adcea4 (patch) | |
tree | b51f08386220bcd60c1a909f73f36233057acfe2 /arch/arm64/crypto/ghash-ce-glue.c | |
parent | 1762818f25f3f99c5083caa13d69e5e5aa2e4b6f (diff) | |
download | linux-458c0480dcb338d7b72e89b2e88a622965adcea4.tar.xz |
crypto: hash - Use memzero_explicit() for clearing state
Without the barrier_data() inside memzero_explicit(), the compiler may
optimize away the state-clearing if it can tell that the state is not
used afterwards.
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm64/crypto/ghash-ce-glue.c')
-rw-r--r-- | arch/arm64/crypto/ghash-ce-glue.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/crypto/ghash-ce-glue.c b/arch/arm64/crypto/ghash-ce-glue.c index 8536008e3e35..2427e2f3a9a1 100644 --- a/arch/arm64/crypto/ghash-ce-glue.c +++ b/arch/arm64/crypto/ghash-ce-glue.c @@ -168,7 +168,7 @@ static int ghash_final(struct shash_desc *desc, u8 *dst) put_unaligned_be64(ctx->digest[1], dst); put_unaligned_be64(ctx->digest[0], dst + 8); - *ctx = (struct ghash_desc_ctx){}; + memzero_explicit(ctx, sizeof(*ctx)); return 0; } |