Thread (153 messages) flat view 153 messages, 6 authors, 2021-01-11
STALE2042d REVIEWED: 1 (0M)

1 review trailer.

[PATCH 5.10 073/145] crypto: asym_tpm: correct zero out potential secrets

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-01-11 13:16:49
Also in: lkml

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

commit f93274ef0fe972c120c96b3207f8fce376231a60 upstream.

The function derive_pub_key() should be calling memzero_explicit()
instead of memset() in case the complier decides to optimize away the
call to memset() because it "knows" no one is going to touch the memory
anymore.

Cc: stable <redacted>
Reported-by: Ilil Blum Shem-Tov <redacted>
Tested-by: Ilil Blum Shem-Tov <redacted>
Link: https://lore.kernel.org/r/X8ns4AfwjKudpyfe@kroah.com (local)
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 crypto/asymmetric_keys/asym_tpm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--- a/crypto/asymmetric_keys/asym_tpm.c
+++ b/crypto/asymmetric_keys/asym_tpm.c
@@ -354,7 +354,7 @@ static uint32_t derive_pub_key(const voi
 	memcpy(cur, e, sizeof(e));
 	cur += sizeof(e);
 	/* Zero parameters to satisfy set_pub_key ABI. */
-	memset(cur, 0, SETKEY_PARAMS_SIZE);
+	memzero_explicit(cur, SETKEY_PARAMS_SIZE);
 
 	return cur - buf;
 }

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help