All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: be2iscsi: Reset the address passed in beiscsi_iface_create_default
@ 2021-04-07  0:24 Aditya Pakki
  2021-04-20  7:18 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Aditya Pakki @ 2021-04-07  0:24 UTC (permalink / raw)
  To: pakki001
  Cc: Subbu Seetharaman, Ketan Mukadam, Jitendra Bhivare,
	James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel

if_info is a local variable that is passed to beiscsi_if_get_info. In
case of failure, the variable is free'd but not reset to NULL. The patch
avoids security issue by passing NULL to if_info.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>
---
 drivers/scsi/be2iscsi/be_iscsi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c
index a13c203ef7a9..1ff9d2a2a876 100644
--- a/drivers/scsi/be2iscsi/be_iscsi.c
+++ b/drivers/scsi/be2iscsi/be_iscsi.c
@@ -274,11 +274,13 @@ void beiscsi_iface_create_default(struct beiscsi_hba *phba)
 	if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V4, &if_info)) {
 		beiscsi_iface_create_ipv4(phba);
 		kfree(if_info);
+		if_info = NULL;
 	}
 
 	if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V6, &if_info)) {
 		beiscsi_iface_create_ipv6(phba);
 		kfree(if_info);
+		if_info = NULL;
 	}
 }
 
-- 
2.25.1


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

* Re: [PATCH] scsi: be2iscsi: Reset the address passed in beiscsi_iface_create_default
  2021-04-07  0:24 [PATCH] scsi: be2iscsi: Reset the address passed in beiscsi_iface_create_default Aditya Pakki
@ 2021-04-20  7:18 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-04-20  7:18 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: Subbu Seetharaman, Ketan Mukadam, Jitendra Bhivare,
	James E.J. Bottomley, Martin K. Petersen, linux-scsi,
	linux-kernel

On Tue, Apr 06, 2021 at 07:24:45PM -0500, Aditya Pakki wrote:
> if_info is a local variable that is passed to beiscsi_if_get_info. In
> case of failure, the variable is free'd but not reset to NULL. The patch
> avoids security issue by passing NULL to if_info.

That is just not true at all.

Stop submitting patches that you know are invalid.  Your experiment is
not ethical, and not welcome or appreciated.

greg k-h

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

end of thread, other threads:[~2021-04-20  7:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07  0:24 [PATCH] scsi: be2iscsi: Reset the address passed in beiscsi_iface_create_default Aditya Pakki
2021-04-20  7:18 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.