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:
Wang Ming 2023-07-17 17:45:19 +08:00 committed by Heiko Carstens
parent 7686762d1e
commit 1f7e906775
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}
}