Re: [Patch edk2-stable202111] NetworkPkg: Fix invalid pointer for DNS response token on error


Michael D Kinney
 

Hi Liming,

 

I agree it is both low risk and prevents an ASSERT() condition that should never be triggered.

 

I approve for edk2-stable202111

 

Mike

 

From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of gaoliming
Sent: Wednesday, November 24, 2021 5:53 PM
To: devel@edk2.groups.io; Wu, Jiaxin <jiaxin.wu@...>; Anbazhagan, Baraneedharan <anbazhagan@...>
Cc: maciej.rabeda@...; Fu, Siyuan <siyuan.fu@...>; leif@...; 'Andrew Fish' <afish@...>; Kinney, Michael D <michael.d.kinney@...>
Subject: 回复: [edk2-devel] [Patch edk2-stable202111] NetworkPkg: Fix invalid pointer for DNS response token on error

 

I suggest to merge this fix for the stable tag 202111. This fix is low risk.

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Wu, Jiaxin
发送时间: 20211125 9:37
收件人: Anbazhagan, Baraneedharan <anbazhagan@...>; devel@edk2.groups.io
抄送: maciej.rabeda@...; Fu, Siyuan <siyuan.fu@...>
主题: Re: [edk2-devel] NetworkPkg: Fix invalid pointer for DNS response token on error

 

Reviewed-by: Wu Jiaxin <jiaxin.wu@...>

 

 

 

From: Anbazhagan, Baraneedharan <anbazhagan@...>
Sent: Thursday, November 25, 2021 9:28 AM
To: devel@edk2.groups.io
Cc: maciej.rabeda@...; Wu, Jiaxin <jiaxin.wu@...>; Fu, Siyuan <siyuan.fu@...>
Subject: RE: NetworkPkg: Fix invalid pointer for DNS response token on error

 

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3719

 

Token->RspData.H2AData is de-allocated on error but it is not

set to NULL. HTTP module attempts to free again and cause assert.

 

Signed-off-by: Baraneedharan Anbazhagan anbazhagan@...

---

NetworkPkg/DnsDxe/DnsImpl.c | 2 ++

1 file changed, 2 insertions(+)

 

diff --git a/NetworkPkg/DnsDxe/DnsImpl.c b/NetworkPkg/DnsDxe/DnsImpl.c

index 2edcb280ac..78a56f2b56 100644

--- a/NetworkPkg/DnsDxe/DnsImpl.c

+++ b/NetworkPkg/DnsDxe/DnsImpl.c

@@ -1700,6 +1700,7 @@ ON_EXIT:

           }

 

           FreePool (Dns4TokenEntry->Token->RspData.H2AData);

+          Dns4TokenEntry->Token->RspData.H2AData = NULL;

         }

       }

     }

@@ -1731,6 +1732,7 @@ ON_EXIT:

           }

 

           FreePool (Dns6TokenEntry->Token->RspData.H2AData);

+          Dns6TokenEntry->Token->RspData.H2AData = NULL;

         }

       }

     }

--

2.33.0.windows.2

 

Join devel@edk2.groups.io to automatically receive all group messages.