linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] crypto: keywrap - memzero the correct memory
@ 2016-01-30 14:38 Dan Carpenter
  2016-01-31 13:00 ` Stephan Mueller
  2016-02-01 14:35 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2016-01-30 14:38 UTC (permalink / raw)
  To: Herbert Xu, Stephan Mueller
  Cc: David S. Miller, linux-crypto, linux-kernel, kernel-janitors

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;
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] crypto: keywrap - memzero the correct memory
  2016-01-30 14:38 [patch] crypto: keywrap - memzero the correct memory Dan Carpenter
@ 2016-01-31 13:00 ` Stephan Mueller
  2016-02-01 14:35 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Stephan Mueller @ 2016-01-31 13:00 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel, kernel-janitors

Am Samstag, 30. Januar 2016, 17:38:28 schrieb Dan Carpenter:

Hi Dan,

> 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>

Thanks
Stephan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] crypto: keywrap - memzero the correct memory
  2016-01-30 14:38 [patch] crypto: keywrap - memzero the correct memory Dan Carpenter
  2016-01-31 13:00 ` Stephan Mueller
@ 2016-02-01 14:35 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2016-02-01 14:35 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Stephan Mueller, David S. Miller, linux-crypto, linux-kernel,
	kernel-janitors

On Sat, Jan 30, 2016 at 05:38:28PM +0300, Dan Carpenter wrote:
> 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>

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-01 14:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-30 14:38 [patch] crypto: keywrap - memzero the correct memory Dan Carpenter
2016-01-31 13:00 ` Stephan Mueller
2016-02-01 14:35 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).