From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web09.11034.1648822350565572659 for ; Fri, 01 Apr 2022 07:12:30 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=ep+xIXxJ; spf=pass (domain: linux.microsoft.com, ip: 13.77.154.182, mailfrom: mikuback@linux.microsoft.com) Received: from [192.168.4.22] (unknown [47.202.59.224]) by linux.microsoft.com (Postfix) with ESMTPSA id 479F820DEEC6; Fri, 1 Apr 2022 07:12:29 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 479F820DEEC6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1648822350; bh=z9LAzi3a2bG/ETp57ARoj0iRSw522C/SYgWUq5uJEc0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ep+xIXxJPw0eB431ZejZluPDfjnKIEYyxFT7kBiS2Dw5yGbkc+VYe23UGe73lbBOa yN3JVId5QW9OXTxL7Fm9NVKAJl67RgmBm35BawgM8SiDY/c+LL8Sd4c+bDLwjRy73q muLT7ITg/JPiWrhGfgN5i0ZyRB0jmpUfU3RflSRo= Message-ID: <92750dff-9946-34d4-cce1-00feb47d351c@linux.microsoft.com> Date: Fri, 1 Apr 2022 10:12:27 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] MinPlatformPkg/TestPointCheckLib: Fix mis-parsed HSTI structures To: devel@edk2.groups.io, chasel.chiu@intel.com Cc: Bret Barkelew , "Desimone, Nathaniel L" , "Gao, Liming" , "Dong, Eric" References: <20220323011053.9546-1-mikuback@linux.microsoft.com> From: "Michael Kubacki" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Thanks for the review. Can you please merge this soon if there are no concerns? On 3/23/2022 2:14 AM, Chiu, Chasel wrote: > > Reviewed-by: Chasel Chiu > > >> -----Original Message----- >> From: mikuback@linux.microsoft.com >> Sent: Wednesday, March 23, 2022 9:11 AM >> To: devel@edk2.groups.io >> Cc: Bret Barkelew ; Chiu, Chasel >> ; Desimone, Nathaniel L >> ; Gao, Liming >> ; Dong, Eric >> Subject: [edk2-platforms][PATCH v1 1/1] >> MinPlatformPkg/TestPointCheckLib: Fix mis-parsed HSTI structures >> >> From: Michael Kubacki >> >> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3612 >> >> Printing corruption can occur if the DumpHsti helper function encounters a >> structure from the IHV (i.e. one that contains the 'Required' field). >> >> Co-authored-by: Bret Barkelew >> Cc: Chasel Chiu >> Cc: Nate DeSimone >> Cc: Liming Gao >> Cc: Eric Dong >> Signed-off-by: Michael Kubacki >> --- >> >> Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckH >> sti.c | 12 +++++++++++- >> 1 file changed, 11 insertions(+), 1 deletion(-) >> >> diff --git >> a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeChec >> kHsti.c >> b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeChec >> kHsti.c >> index 7756369ae17b..f2f3fa83a57c 100644 >> --- >> a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeChec >> kHsti.c >> +++ >> b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh >> +++ eckHsti.c >> @@ -40,6 +40,16 @@ DumpHsti ( >> DEBUG ((DEBUG_INFO, " SecurityFeaturesSize - 0x%08x\n", Hsti- >>> SecurityFeaturesSize)); >> >> SecurityFeatures = (UINT8 *) (Hsti + 1); >> + >> + if (Hsti->Role == PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE) { >> + DEBUG ((DEBUG_INFO, " SecurityFeaturesRequired - ")); >> + for (Index = 0; Index < Hsti->SecurityFeaturesSize; Index++) { >> + DEBUG ((DEBUG_INFO, "%02x ", SecurityFeatures[Index])); >> + } >> + DEBUG ((DEBUG_INFO, "\n")); >> + SecurityFeatures = (UINT8 *) (SecurityFeatures + >> + Hsti->SecurityFeaturesSize); } >> + >> DEBUG ((DEBUG_INFO, " SecurityFeaturesImplemented - ")); >> for (Index = 0; Index < Hsti->SecurityFeaturesSize; Index++) { >> DEBUG ((DEBUG_INFO, "%02x ", SecurityFeatures[Index])); @@ -81,7 >> +91,7 @@ TestPointCheckHsti ( >> EFI_STATUS Status; >> UINTN Index; >> BOOLEAN Result; >> - >> + >> Result = TRUE; >> DEBUG ((DEBUG_INFO, "==== TestPointCheckHsti - Enter\n")); >> for (Index = 0; Index < sizeof(mRole)/sizeof(mRole[0]); Index++) { >> -- >> 2.28.0.windows.1 > > > > >