s390/crypto: use kfree_sensitive() instead of kfree()
key might contain private part of the key, so better use kfree_sensitive() to free it. Signed-off-by: Wang Ming <machel@vivo.com> Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Link: https://lore.kernel.org/r/20230717094533.18418-1-machel@vivo.com Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
This commit is contained in:
parent
7686762d1e
commit
1f7e906775
|
@ -103,7 +103,7 @@ static inline void _free_kb_keybuf(struct key_blob *kb)
|
|||
{
|
||||
if (kb->key && kb->key != kb->keybuf
|
||||
&& kb->keylen > sizeof(kb->keybuf)) {
|
||||
kfree(kb->key);
|
||||
kfree_sensitive(kb->key);
|
||||
kb->key = NULL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue