public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] scsi: iscsi: use kfree_sensitive() in iscsi_session_free()
@ 2023-07-17  9:26 Minjie Du
  2023-07-17 17:31 ` Lee Duncan
  2023-07-17 18:25 ` Mike Christie
  0 siblings, 2 replies; 4+ messages in thread
From: Minjie Du @ 2023-07-17  9:26 UTC (permalink / raw)
  To: Lee Duncan, Chris Leech, Mike Christie, James E.J. Bottomley,
	Martin K. Petersen, open list:ISCSI, open list:ISCSI, open list
  Cc: opensource.kernel, Minjie Du

session might contain private part of the password, so better use
kfree_sensitive() to free it.
In iscsi_session_free() use kfree_sensitive() to free session->password.

Signed-off-by: Minjie Du <duminjie@vivo.com>
---
 drivers/scsi/libiscsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 0fda8905e..2f273229c 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -3132,7 +3132,7 @@ void iscsi_session_free(struct iscsi_cls_session *cls_session)
 	struct module *owner = cls_session->transport->owner;
 
 	iscsi_pool_free(&session->cmdpool);
-	kfree(session->password);
+	kfree_sensitive(session->password);
 	kfree(session->password_in);
 	kfree(session->username);
 	kfree(session->username_in);
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-07-19 14:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-17  9:26 [PATCH v1] scsi: iscsi: use kfree_sensitive() in iscsi_session_free() Minjie Du
2023-07-17 17:31 ` Lee Duncan
2023-07-17 18:25 ` Mike Christie
     [not found]   ` <SG2PR06MB5288D9E4D3124B5577ACA035AE39A@SG2PR06MB5288.apcprd06.prod.outlook.com>
2023-07-19 14:53     ` 回复: " Lee Duncan

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