mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1] s390/crypto: use kfree_sensitive in _free_kb_keybuf()
@ 2023-07-17  7:41 Minjie Du
  0 siblings, 0 replies; only message in thread
From: Minjie Du @ 2023-07-17  7:41 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Heiko Carstens, Vasily Gorbik,
	Alexander Gordeev, Christian Borntraeger, Sven Schnelle,
	open list:CRYPTO API, open list:S390 ARCHITECTURE, open list
  Cc: opensource.kernel, Minjie Du

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-17  7:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17  7:41 [PATCH v1] s390/crypto: use kfree_sensitive in _free_kb_keybuf() Minjie Du

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®