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


Groups > linux.kernel > #1322381 > unrolled thread

[patch] crypto: keywrap - memzero the correct memory

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2016-01-30 15:50 +0100
Last post2016-02-01 15:40 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [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

#1322381 — [patch] crypto: keywrap - memzero the correct memory

FromDan Carpenter <dan.carpenter@oracle.com>
Date2016-01-30 15:50 +0100
Subject[patch] crypto: keywrap - memzero the correct memory
Message-ID<qWF0C-4FU-17@gated-at.bofh.it>
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;
 }

[toc] | [next] | [standalone]


#1322647

FromStephan Mueller <smueller@chronox.de>
Date2016-01-31 14:10 +0100
Message-ID<qWZVo-3LH-5@gated-at.bofh.it>
In reply to#1322381
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

[toc] | [prev] | [next] | [standalone]


#1323182

FromHerbert Xu <herbert@gondor.apana.org.au>
Date2016-02-01 15:40 +0100
Message-ID<qXnO9-4aB-183@gated-at.bofh.it>
In reply to#1322381
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web