Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1322381

[patch] crypto: keywrap - memzero the correct memory

From Dan Carpenter <dan.carpenter@oracle.com>
Newsgroups linux.kernel
Subject [patch] crypto: keywrap - memzero the correct memory
Date 2016-01-30 15:50 +0100
Message-ID <qWF0C-4FU-17@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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>

diff --git a/crypto/keywrap.c b/crypto/keywrap.c
index b1d106c..72014f9 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;
 }

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[patch] crypto: keywrap - memzero the correct memory Dan Carpenter <dan.carpenter@oracle.com> - 2016-01-30 15:50 +0100
  Re: [patch] crypto: keywrap - memzero the correct memory Stephan Mueller <smueller@chronox.de> - 2016-01-31 14:10 +0100
  Re: [patch] crypto: keywrap - memzero the correct memory Herbert Xu <herbert@gondor.apana.org.au> - 2016-02-01 15:40 +0100

csiph-web