[patch] NetworkPkg: Fix assert issue in iSCSI driver


Zhang Lubo <lubo.zhang@...>
 

The bug is caused by using already freed memory.
If there is already an attempt and execute
'reconnect -r' command, all the AttemptConfig structure
will be freed, 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: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
NetworkPkg/IScsiDxe/IScsiMisc.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c
index deebf5d..a39c268 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -898,10 +898,12 @@ IScsiCleanDriverData (

EXIT:

gBS->CloseEvent (Private->ExitBootServiceEvent);

+ mCallbackInfo->Current = NULL;
+
FreePool (Private);
return Status;
}

/**
--
1.9.5.msysgit.1


Ye, Ting <ting.ye@...>
 

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

-----Original Message-----
From: Zhang, Lubo
Sent: Monday, August 01, 2016 4:38 PM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Ye, Ting <ting.ye@intel.com>; Wu, Jiaxin <jiaxin.wu@intel.com>
Subject: [patch] NetworkPkg: Fix assert issue in iSCSI driver

The bug is caused by using already freed memory.
If there is already an attempt and execute 'reconnect -r' command, all the AttemptConfig structure will be freed, 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: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
NetworkPkg/IScsiDxe/IScsiMisc.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c b/NetworkPkg/IScsiDxe/IScsiMisc.c index deebf5d..a39c268 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -898,10 +898,12 @@ IScsiCleanDriverData (

EXIT:

gBS->CloseEvent (Private->ExitBootServiceEvent);

+ mCallbackInfo->Current = NULL;
+
FreePool (Private);
return Status;
}

/**
--
1.9.5.msysgit.1


Siyuan, Fu
 

Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>

-----Original Message-----
From: Zhang, Lubo
Sent: Monday, August 1, 2016 4:38 PM
To: edk2-devel@lists.01.org
Cc: Fu, Siyuan <siyuan.fu@intel.com>; Ye, Ting <ting.ye@intel.com>; Wu,
Jiaxin <jiaxin.wu@intel.com>
Subject: [patch] NetworkPkg: Fix assert issue in iSCSI driver

The bug is caused by using already freed memory.
If there is already an attempt and execute
'reconnect -r' command, all the AttemptConfig structure
will be freed, 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: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
---
NetworkPkg/IScsiDxe/IScsiMisc.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.c
b/NetworkPkg/IScsiDxe/IScsiMisc.c
index deebf5d..a39c268 100644
--- a/NetworkPkg/IScsiDxe/IScsiMisc.c
+++ b/NetworkPkg/IScsiDxe/IScsiMisc.c
@@ -898,10 +898,12 @@ IScsiCleanDriverData (

EXIT:

gBS->CloseEvent (Private->ExitBootServiceEvent);

+ mCallbackInfo->Current = NULL;
+
FreePool (Private);
return Status;
}

/**
--
1.9.5.msysgit.1