s390/crypto: use kfree_sensitive() instead of kfree()
authorWang Ming <machel@vivo.com>
Mon, 17 Jul 2023 09:45:19 +0000 (17:45 +0800)
committerHeiko Carstens <hca@linux.ibm.com>
Thu, 20 Jul 2023 14:48:56 +0000 (16:48 +0200)
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>
arch/s390/crypto/paes_s390.c

index d29a9d9..3834915 100644 (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;
        }
 }