diff mbox series

[v1] s390/crypto: use kfree_sensitive in _free_kb_keybuf()

Message ID 20230717074112.6580-1-duminjie@vivo.com
State New
Headers show
Series [v1] s390/crypto: use kfree_sensitive in _free_kb_keybuf() | expand

Commit Message

Minjie Du July 17, 2023, 7:41 a.m. UTC
key might contain private part of the key, so better use
kfree_sensitive to free it.


Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 arch/s390/crypto/paes_s390.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/s390/crypto/paes_s390.c b/arch/s390/crypto/paes_s390.c
index d29a9d908..38349150c 100644
--- a/arch/s390/crypto/paes_s390.c
+++ b/arch/s390/crypto/paes_s390.c
@@ -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;
 	}
 }