summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-01-30 17:38:28 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-04-12 09:08:45 -0700
commitf69c1b51f6da629e6f03b336ffec8c31b56e6f8a (patch)
tree254dcbc28ef8c9f12bca36e600b7bcd0ee827ffc /crypto
parent0cdc91f539d77f4be720330f577b708a56cc9391 (diff)
crypto: keywrap - memzero the correct memory
commit 2b8b28fd232233c22fb61009dd8b0587390d2875 upstream. We're clearing the wrong memory. The memory corruption is likely harmless because we weren't going to use that stack memory again but not zeroing is a potential information leak. Fixes: e28facde3c39 ('crypto: keywrap - add key wrapping block chaining mode') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/keywrap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/keywrap.c b/crypto/keywrap.c
index b1d106ce55f3..72014f963ba7 100644
--- a/crypto/keywrap.c
+++ b/crypto/keywrap.c
@@ -212,7 +212,7 @@ static int crypto_kw_decrypt(struct blkcipher_desc *desc,
SEMIBSIZE))
ret = -EBADMSG;
- memzero_explicit(&block, sizeof(struct crypto_kw_block));
+ memzero_explicit(block, sizeof(struct crypto_kw_block));
return ret;
}
@@ -297,7 +297,7 @@ static int crypto_kw_encrypt(struct blkcipher_desc *desc,
/* establish the IV for the caller to pick up */
memcpy(desc->info, block->A, SEMIBSIZE);
- memzero_explicit(&block, sizeof(struct crypto_kw_block));
+ memzero_explicit(block, sizeof(struct crypto_kw_block));
return 0;
}