From ad553d0853e98883e30442740626d820497d6918 Mon Sep 17 00:00:00 2001 From: Doug Flick Date: Thu, 30 May 2024 17:12:23 -0700 Subject: [PATCH] =?UTF-8?q?NetworkPkg=20TcpDxe:=20Fixed=20system=20stuck?= =?UTF-8?q?=20on=20PXE=20boot=20flow=20in=20iPXE=20enviro=E2=80=A6=20(#879?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This bug fix is based on the following commit "NetworkPkg TcpDxe: SECURITY PATCH" REF: 1904a64 Issue Description: An "Invalid handle" error was detected during runtime when attempting to destroy a child instance of the hashing protocol. The problematic code segment was: NetworkPkg\TcpDxe\TcpDriver.c Status = Hash2ServiceBinding->DestroyChild(Hash2ServiceBinding, ​&mHash2ServiceHandle); Root Cause Analysis: The root cause of the error was the passing of an incorrect parameter type, a pointer to an EFI_HANDLE instead of an EFI_HANDLE itself, to the DestroyChild function. This mismatch resulted in the function receiving an invalid handle. Implemented Solution: To resolve this issue, the function call was corrected to pass mHash2ServiceHandle directly: NetworkPkg\TcpDxe\TcpDriver.c Status = Hash2ServiceBinding->DestroyChild(Hash2ServiceBinding, mHash2ServiceHandle); This modification ensures the correct handle type is used, effectively rectifying the "Invalid handle" error. Verification: Testing has been conducted, confirming the efficacy of the fix. Additionally, the BIOS can boot into the OS in an iPXE environment. Cc: Doug Flick [MSFT] Reviewed-by: Saloni Kasbekar - [ X] Impacts functionality? - Corrects handle passed to DestroyChild(..) - [ ] Impacts security? - N/A - [ ] Breaking change? - N/A - [ ] Includes tests? - N/A - [ ] Includes documentation? - N/A ## How This Was Tested "Testing has been conducted, confirming the efficacy of the fix. Additionally, the BIOS can boot into the OS in an iPXE environment." iPXE booted successfully ## Integration Instructions N/A Signed-off-by: Sam Tsai [Wiwynn] Co-authored-by: Sam --- NetworkPkg/TcpDxe/TcpDriver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetworkPkg/TcpDxe/TcpDriver.c b/NetworkPkg/TcpDxe/TcpDriver.c index cb87064542..ccd816d333 100644 --- a/NetworkPkg/TcpDxe/TcpDriver.c +++ b/NetworkPkg/TcpDxe/TcpDriver.c @@ -509,7 +509,7 @@ TcpDestroyService ( // // Destroy the instance of the hashing protocol for this controller. // - Status = Hash2ServiceBinding->DestroyChild (Hash2ServiceBinding, &mHash2ServiceHandle); + Status = Hash2ServiceBinding->DestroyChild (Hash2ServiceBinding, mHash2ServiceHandle); if (EFI_ERROR (Status)) { return EFI_UNSUPPORTED; }