Skip to content

Commit 1f7e906

Browse files
Wang Minghcahca
authored andcommitted
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>
1 parent 7686762 commit 1f7e906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/crypto/paes_s390.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static inline void _free_kb_keybuf(struct key_blob *kb)
103103
{
104104
if (kb->key && kb->key != kb->keybuf
105105
&& kb->keylen > sizeof(kb->keybuf)) {
106-
kfree(kb->key);
106+
kfree_sensitive(kb->key);
107107
kb->key = NULL;
108108
}
109109
}

0 commit comments

Comments
 (0)