public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [patch] MdeModulePkg: Fix assert in iSCSI.
@ 2016-12-01  6:58 Zhang Lubo
  2016-12-07  7:06 ` Tian, Feng
  2016-12-07  7:46 ` Ye, Ting
  0 siblings, 2 replies; 3+ messages in thread
From: Zhang Lubo @ 2016-12-01  6:58 UTC (permalink / raw)
  To: edk2-devel; +Cc: Ye Ting, Fu Siyuan, Wu Jiaxin

The bug is caused by using already freed memory.
If there is already an attempt and execute
'reconnect -r' command, all the ConfigFormEntry structure
will be freed in IScsiDriverBindingStop, but the
mCallbackInfo->Current is not configured as null and
this pointer will be used again in IScsiFormExtractConfig.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
index 77ccd67..ea727af 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
@@ -1074,10 +1074,11 @@ IScsiConfigUpdateForm (
     ASSERT (EntryExisted);
 
     mNumberOfIScsiDevices--;
     RemoveEntryList (&ConfigFormEntry->Link);
     FreePool (ConfigFormEntry);
+    mCallbackInfo->Current = NULL;
   }
   //
   // Allocate space for creation of Buffer
   //
 
-- 
1.9.5.msysgit.1



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

* Re: [patch] MdeModulePkg: Fix assert in iSCSI.
  2016-12-01  6:58 [patch] MdeModulePkg: Fix assert in iSCSI Zhang Lubo
@ 2016-12-07  7:06 ` Tian, Feng
  2016-12-07  7:46 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Tian, Feng @ 2016-12-07  7:06 UTC (permalink / raw)
  To: Zhang, Lubo, edk2-devel@lists.01.org
  Cc: Ye, Ting, Fu, Siyuan, Wu, Jiaxin, Tian, Feng

Reviewed-by: Feng Tian <feng.tian@intel.com>

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang Lubo
Sent: Thursday, December 1, 2016 2:59 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [patch] MdeModulePkg: Fix assert in iSCSI.

The bug is caused by using already freed memory.
If there is already an attempt and execute 'reconnect -r' command, all the ConfigFormEntry structure will be freed in IScsiDriverBindingStop, but the
mCallbackInfo->Current is not configured as null and
this pointer will be used again in IScsiFormExtractConfig.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
index 77ccd67..ea727af 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
@@ -1074,10 +1074,11 @@ IScsiConfigUpdateForm (
     ASSERT (EntryExisted);
 
     mNumberOfIScsiDevices--;
     RemoveEntryList (&ConfigFormEntry->Link);
     FreePool (ConfigFormEntry);
+    mCallbackInfo->Current = NULL;
   }
   //
   // Allocate space for creation of Buffer
   //
 
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


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

* Re: [patch] MdeModulePkg: Fix assert in iSCSI.
  2016-12-01  6:58 [patch] MdeModulePkg: Fix assert in iSCSI Zhang Lubo
  2016-12-07  7:06 ` Tian, Feng
@ 2016-12-07  7:46 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2016-12-07  7:46 UTC (permalink / raw)
  To: Zhang, Lubo, edk2-devel@lists.01.org; +Cc: Fu, Siyuan, Wu, Jiaxin

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Zhang Lubo
Sent: Thursday, December 1, 2016 2:59 PM
To: edk2-devel@lists.01.org
Cc: Ye, Ting <ting.ye@intel.com>; Fu, Siyuan <siyuan.fu@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [edk2] [patch] MdeModulePkg: Fix assert in iSCSI.

The bug is caused by using already freed memory.
If there is already an attempt and execute 'reconnect -r' command, all the ConfigFormEntry structure will be freed in IScsiDriverBindingStop, but the
mCallbackInfo->Current is not configured as null and
this pointer will be used again in IScsiFormExtractConfig.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
 MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
index 77ccd67..ea727af 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
@@ -1074,10 +1074,11 @@ IScsiConfigUpdateForm (
     ASSERT (EntryExisted);
 
     mNumberOfIScsiDevices--;
     RemoveEntryList (&ConfigFormEntry->Link);
     FreePool (ConfigFormEntry);
+    mCallbackInfo->Current = NULL;
   }
   //
   // Allocate space for creation of Buffer
   //
 
--
1.9.5.msysgit.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


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

end of thread, other threads:[~2016-12-07  7:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-01  6:58 [patch] MdeModulePkg: Fix assert in iSCSI Zhang Lubo
2016-12-07  7:06 ` Tian, Feng
2016-12-07  7:46 ` Ye, Ting

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