Skip to contentSkip to conversation

crypto: keywrap - memzero the correct memory

PATCH Applied Dan Carpenter 3 participants 3 messages Jan 30, 2016 – Feb 1, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: keywrap - memzero the correct memory

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')
crypto/keywrap.c +2 -2
index b1d106c..72014f9 100644
@@ -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;
 }
Acked-by on v1 1/1
#1 lore raw

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

Hi Dan,

Quoted 6 lines

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 <[email protected]>

Thanks
Stephan

maintainer Applied
#2 lore raw
In reply to Dan Carpenter
Quoted 6 lines · Dan Carpenter

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

Applied.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt