Skip to content

Commit

Permalink
s390/crypto: use kfree_sensitive() instead of kfree()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wang Ming authored and Heiko Carstens committed Jul 20, 2023
1 parent 7686762 commit 1f7e906
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/s390/crypto/paes_s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 1f7e906

Please sign in to comment.