Skip to content

Commit f93274e

Browse files
committed
crypto: asym_tpm: correct zero out potential secrets
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 <[email protected]> Reported-by: Ilil Blum Shem-Tov <[email protected]> Tested-by: Ilil Blum Shem-Tov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0acfbe9 commit f93274e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/asymmetric_keys/asym_tpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf)
354354
memcpy(cur, e, sizeof(e));
355355
cur += sizeof(e);
356356
/* Zero parameters to satisfy set_pub_key ABI. */
357-
memset(cur, 0, SETKEY_PARAMS_SIZE);
357+
memzero_explicit(cur, SETKEY_PARAMS_SIZE);
358358

359359
return cur - buf;
360360
}

0 commit comments

Comments
 (0)