mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
crypto: asym_tpm: correct zero out potential secrets
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 <[email protected]> Reported-by: Ilil Blum Shem-Tov <[email protected]> Tested-by: Ilil Blum Shem-Tov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
ff7397add9
commit
867c10a03f
1 changed files with 1 additions and 1 deletions
|
|
@ -370,7 +370,7 @@ static uint32_t derive_pub_key(const void *pub_key, uint32_t len, uint8_t *buf)
|
|||
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue