Re: [edk2-devel] [PATCH] MinPlatformPkg/SecFspWrapperPlatformSecLib: Change TopOfTemporaryRam type
Hi chasel, > -Original Message- > From: Chiu, Chasel > Sent: Wednesday, September 4, 2019 8:13 PM > To: devel@edk2.groups.io; Zhang, Shenglei > Cc: Kubacki, Michael A ; Desimone, Nathaniel > L ; Gao, Liming > Subject: RE: [edk2-devel] [PATCH] > MinPlatformPkg/SecFspWrapperPlatformSecLib: Change > TopOfTemporaryRam type > > > Hi Shenglei, > > Would you please elaborate a little on how casting to UINTN can resolve the > overflow scenario and why 64bits OS will affect this code? Actually casting to UINTN can't resolve the overflow. What I mean is the result of (TopOfTemporaryRam - sizeof (UINT32)) may overflow. While it's meaningless to cast an already overflowed result to another type. So I update the code to cast the variable to UINT before it is arithmetically operated. Under 64bits OS, the size of UINTN is 64-bit and the original "(TopOfTemporaryRam - sizeof (UINT32)) " is 32-bit. So the operation for casting will be performed. That's why 64bits OS will affect this code. Thanks, Shenglei > > Thanks! > Chasel > > > -----Original Message- > > From: devel@edk2.groups.io On Behalf Of Zhang, > > Shenglei > > Sent: Monday, September 2, 2019 8:35 PM > > To: devel@edk2.groups.io > > Cc: Kubacki, Michael A ; Chiu, Chasel > > ; Desimone, Nathaniel L > > ; Gao, Liming > > Subject: [edk2-devel] [PATCH] > MinPlatformPkg/SecFspWrapperPlatformSecLib: > > Change TopOfTemporaryRam type > > > > Cast TopOfTemporaryRam's from UINT32 to UINTN in the expression. > > The original code (TopOfTemporaryRam - sizeof (UINT32)) may cause > > overflow. As a result the operation under 64-bit OS environment, > (UINT)(...), > > may cast a overflowed 4-byte result to 8-byte one. > > > > Cc: Michael Kubacki > > Cc: Chasel Chiu > > Cc: Nate DeSimone > > Cc: Liming Gao > > Signed-off-by: Shenglei Zhang > > --- > > .../Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c | 2 +- > > .../SecFspWrapperPlatformSecLib/SecPlatformInformation.c| 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git > > > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > or > > mSecLib/SecGetPerformance.c > > > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > or > > mSecLib/SecGetPerformance.c > > index c4eeb2b1..0cc42f96 100644 > > --- > > > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > or > > mSecLib/SecGetPerformance.c > > +++ > > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat > > +++ formSecLib/SecGetPerformance.c > > @@ -79,7 +79,7 @@ SecGetPerformance ( > >// > >TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - > > sizeof(UINT32); > >TopOfTemporaryRam -= sizeof(UINT32) * 2; > > - Count = *(UINT32 *) (UINTN) (TopOfTemporaryRam - sizeof > > (UINT32)); > > + Count = *(UINT32 *)((UINTN)TopOfTemporaryRam - sizeof > > (UINT32)); > >Size = Count * sizeof (UINT32); > > > >Ticker = *(UINT64 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32) - > Size > > - sizeof (UINT32) * 2); diff --git > > > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > or > > mSecLib/SecPlatformInformation.c > > > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > or > > mSecLib/SecPlatformInformation.c > > index 5b94ed2b..1bcee5f4 100644 > > --- > > > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > or > > mSecLib/SecPlatformInformation.c > > +++ > > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlat > > +++ formSecLib/SecPlatformInformation.c > > @@ -61,7 +61,7 @@ SecPlatformInformation ( > >// > >TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof > > (UINT32); > >TopOfTemporaryRam -= sizeof(UINT32) * 2; > > - Count = *((UINT32 *)(UINTN) (TopOfTemporaryRam - sizeof > > (UINT32))); > > + Count = *((UINT32 *)((UINTN)TopOfTemporaryRam - sizeof > > (UINT32))); > >Size = Count * sizeof (IA32_HANDOFF_STATUS); > > > >if ((*StructureSize) < (UINT64) Size) { > > -- > > 2.18.0.windows.1 > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46857): https://edk2.groups.io/g/devel/message/46857 Mute This Topic: https://groups.io/mt/33110619/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MinPlatformPkg/SecFspWrapperPlatformSecLib: Change TopOfTemporaryRam type
It works after I apply the change according to your advice. And that makes the code more clean. Thanks for your advice. I'll sent out a v2 patch. Best Regards, Shenglei > -Original Message- > From: Chiu, Chasel > Sent: Thursday, September 5, 2019 10:54 AM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Kubacki, Michael A ; Desimone, Nathaniel > L ; Gao, Liming > Subject: RE: [edk2-devel] [PATCH] > MinPlatformPkg/SecFspWrapperPlatformSecLib: Change > TopOfTemporaryRam type > > > Thanks for explanations. > So looks like the intention is to support X64 build scenarios, I think > TopOfTemporaryRam should be defined as UINTN from beginning so it can > hold 64bits address in X64 build. > Please evaluate if we could make these changes. > > Thanks! > Chasel > > > -Original Message- > > From: Zhang, Shenglei > > Sent: Thursday, September 5, 2019 10:11 AM > > To: Chiu, Chasel ; devel@edk2.groups.io > > Cc: Kubacki, Michael A ; Desimone, > Nathaniel > > L ; Gao, Liming > > Subject: RE: [edk2-devel] [PATCH] > > MinPlatformPkg/SecFspWrapperPlatformSecLib: Change > > TopOfTemporaryRam type > > > > Hi chasel, > > > > > -Original Message- > > > From: Chiu, Chasel > > > Sent: Wednesday, September 4, 2019 8:13 PM > > > To: devel@edk2.groups.io; Zhang, Shenglei > > > Cc: Kubacki, Michael A ; Desimone, > > > Nathaniel L ; Gao, Liming > > > > > > Subject: RE: [edk2-devel] [PATCH] > > > MinPlatformPkg/SecFspWrapperPlatformSecLib: Change > > TopOfTemporaryRam > > > type > > > > > > > > > Hi Shenglei, > > > > > > Would you please elaborate a little on how casting to UINTN can > > > resolve the overflow scenario and why 64bits OS will affect this code? > > > > Actually casting to UINTN can't resolve the overflow. > > What I mean is the result of (TopOfTemporaryRam - sizeof (UINT32)) may > > overflow. > > While it's meaningless to cast an already overflowed result to another type. > > So I update the code to cast the variable to UINT before it is > > arithmetically > > operated. > > > > Under 64bits OS, the size of UINTN is 64-bit and the original > > "(TopOfTemporaryRam - sizeof (UINT32)) " > > is 32-bit. So the operation for casting will be performed. That's why 64bits > > OS will affect this code. > > > > Thanks, > > Shenglei > > > > > > > > Thanks! > > > Chasel > > > > > > > -Original Message- > > > > From: devel@edk2.groups.io On Behalf Of > > > > Zhang, Shenglei > > > > Sent: Monday, September 2, 2019 8:35 PM > > > > To: devel@edk2.groups.io > > > > Cc: Kubacki, Michael A ; Chiu, Chasel > > > > ; Desimone, Nathaniel L > > > > ; Gao, Liming > > > > Subject: [edk2-devel] [PATCH] > > > MinPlatformPkg/SecFspWrapperPlatformSecLib: > > > > Change TopOfTemporaryRam type > > > > > > > > Cast TopOfTemporaryRam's from UINT32 to UINTN in the expression. > > > > The original code (TopOfTemporaryRam - sizeof (UINT32)) may cause > > > > overflow. As a result the operation under 64-bit OS environment, > > > (UINT)(...), > > > > may cast a overflowed 4-byte result to 8-byte one. > > > > > > > > Cc: Michael Kubacki > > > > Cc: Chasel Chiu > > > > Cc: Nate DeSimone > > > > Cc: Liming Gao > > > > Signed-off-by: Shenglei Zhang > > > > --- > > > > .../Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c | 2 > > +- > > > > .../SecFspWrapperPlatformSecLib/SecPlatformInformation.c| 2 > > +- > > > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git > > > > > > > > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > > > or > > > > mSecLib/SecGetPerformance.c > > > > > > > > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > > > or > > > > mSecLib/SecGetPerformance.c > > > > index c4eeb2b1..0cc42f96 100644 > > > > --- > > > > > > > > a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatf > > > or > > > > mSecLib/SecGetPerformance.c > > > > +++ > > > > > > b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapper
[edk2-devel] [PATCH v2] MinPlatformPkg/SecFspWrapperPlatformSecLib: Change TopOfTemporaryRam type
Update the type of TopOfTemporaryRam from UINT32 to UINTN. This change is intended to support X64 build scenarios. The original code(line 64) may cast the overfloewed result produced by "(TopOfTemporaryRam - sizeof (UINT32))"from 32bit to 64bit. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: As TopOfTemporaryRam is defined as UINTN in v2, remove all the related casting operations which exist in v1 patch. .../SecFspWrapperPlatformSecLib/SecGetPerformance.c | 8 .../SecFspWrapperPlatformSecLib/SecPlatformInformation.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c index c4eeb2b1..8535ae04 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecGetPerformance.c @@ -41,7 +41,7 @@ SecGetPerformance ( { UINT32 Size; UINT32 Count; - UINT32 TopOfTemporaryRam; + UINTN TopOfTemporaryRam; UINT64 Ticker; VOID*TopOfTemporaryRamPpi; EFI_STATUS Status; @@ -77,12 +77,12 @@ SecGetPerformance ( // | TSC[31:00] | // |--| // - TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof(UINT32); + TopOfTemporaryRam = (UINTN)TopOfTemporaryRamPpi - sizeof(UINT32); TopOfTemporaryRam -= sizeof(UINT32) * 2; - Count = *(UINT32 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32)); + Count = *(UINT32 *)(TopOfTemporaryRam - sizeof (UINT32)); Size = Count * sizeof (UINT32); - Ticker = *(UINT64 *) (UINTN) (TopOfTemporaryRam - sizeof (UINT32) - Size - sizeof (UINT32) * 2); + Ticker = *(UINT64 *) (TopOfTemporaryRam - sizeof (UINT32) - Size - sizeof (UINT32) * 2); Performance->ResetEnd = GetTimeInNanoSecond (Ticker); return EFI_SUCCESS; diff --git a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecPlatformInformation.c b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecPlatformInformation.c index 5b94ed2b..ade36ab5 100644 --- a/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecPlatformInformation.c +++ b/Platform/Intel/MinPlatformPkg/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecPlatformInformation.c @@ -36,7 +36,7 @@ SecPlatformInformation ( UINT32 *Bist; UINT32 Size; UINT32 Count; - UINT32 TopOfTemporaryRam; + UINTN TopOfTemporaryRam; VOID*TopOfTemporaryRamPpi; EFI_STATUS Status; @@ -59,9 +59,9 @@ SecPlatformInformation ( // This routine copies the BIST information to the buffer pointed by // PlatformInformationRecord for output. // - TopOfTemporaryRam = (UINT32)(UINTN)TopOfTemporaryRamPpi - sizeof (UINT32); + TopOfTemporaryRam = (UINTN)TopOfTemporaryRamPpi - sizeof (UINT32); TopOfTemporaryRam -= sizeof(UINT32) * 2; - Count = *((UINT32 *)(UINTN) (TopOfTemporaryRam - sizeof (UINT32))); + Count = *((UINT32 *)(TopOfTemporaryRam - sizeof (UINT32))); Size = Count * sizeof (IA32_HANDOFF_STATUS); if ((*StructureSize) < (UINT64) Size) { -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46874): https://edk2.groups.io/g/devel/message/46874 Mute This Topic: https://groups.io/mt/33150686/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/2] EmulatorPkg/PeiEmuSerialPortLib: Update the INF file Guid
From: shenglei FILE GUID in PeiEmuSerialPortLib.inf is same to MdePkg\Library\BaseSerialPortLibNull\BaseSerialPortLibNull.inf. PeiEmuSerialPortLib.inf FILE_GUID should be updated. https://bugzilla.tianocore.org/show_bug.cgi?id=2144 Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Shenglei Zhang --- EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf b/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf index f61346174739..2f5e656fd753 100644 --- a/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf +++ b/EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf @@ -12,7 +12,7 @@ [Defines] INF_VERSION= 0x00010005 BASE_NAME = PeiEmuSerialPortLibNull - FILE_GUID = E4541241-8897-411a-91F8-7D7E45837146 + FILE_GUID = 76003416-0373-4C3C-BC4C-87E367FD4BD1 MODULE_TYPE= PEIM VERSION_STRING = 1.0 LIBRARY_CLASS = SerialPortLib| PEI_CORE PEIM SEC -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46885): https://edk2.groups.io/g/devel/message/46885 Mute This Topic: https://groups.io/mt/33151137/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 0/2] Update file guids in INF files
The file guids of PeiEmuSerialPortLib.inf and SerialDxe.inf are same to other guids. So update them to new ones. https://bugzilla.tianocore.org/show_bug.cgi?id=2144 Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Cc: Jian J Wang Cc: Hao A Wu Shenglei Zhang (1): MdeModulePkg/SerialDxe: Update the file Guid in SerialDxe.inf shenglei (1): EmulatorPkg/PeiEmuSerialPortLib: Update the INF file Guid EmulatorPkg/Library/PeiEmuSerialPortLib/PeiEmuSerialPortLib.inf | 2 +- MdeModulePkg/Universal/SerialDxe/SerialDxe.inf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46884): https://edk2.groups.io/g/devel/message/46884 Mute This Topic: https://groups.io/mt/33151136/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 2/2] MdeModulePkg/SerialDxe: Update the file Guid in SerialDxe.inf
FILE GUID in MdeModulePkg\Universal\SerialDxe\SerialDxe.inf is same to the one gEdkiiSerialPortLibVendorGuid. Its FILE GUID should be updated to another value. https://bugzilla.tianocore.org/show_bug.cgi?id=2144 Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/SerialDxe/SerialDxe.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf b/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf index b6c85b3f848d..ab5e045ead3d 100644 --- a/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf +++ b/MdeModulePkg/Universal/SerialDxe/SerialDxe.inf @@ -11,7 +11,7 @@ [Defines] INF_VERSION= 0x00010005 BASE_NAME = SerialDxe MODULE_UNI_FILE= SerialDxe.uni - FILE_GUID = D3987D4B-971A-435F-8CAF-4967EB627241 + FILE_GUID = 3bd86846-4ad0-4e94-81e6-9ea34cd34cxb MODULE_TYPE= DXE_DRIVER VERSION_STRING = 1.0 -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46886): https://edk2.groups.io/g/devel/message/46886 Mute This Topic: https://groups.io/mt/33151138/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] BoardModulePkg/CmosAccessLib: Remove white ending line
Cc: Eric Dong Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .../BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf index 77ea219f..64ae65c4 100644 --- a/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf +++ b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf @@ -25,4 +25,4 @@ [Packages] MdePkg/MdePkg.dec - BoardModulePkg/BoardModulePkg.dec \ No newline at end of file + BoardModulePkg/BoardModulePkg.dec \ No newline at end of file -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46971): https://edk2.groups.io/g/devel/message/46971 Mute This Topic: https://groups.io/mt/33164367/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] Silicon/IntelSiliconPkg: Update the comment format
To make the comments in IntelSiliconPkg consistent with those in other packages, update "@exception" to "@retval" and remove "@result" Cc: Ray Ni Cc: Rangasai V Chaganty Signed-off-by: Shenglei Zhang --- .../SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c | 6 ++ .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c| 2 +- .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h| 6 ++ .../Intel/IntelSiliconPkg/Include/Library/SmmAccessLib.h| 6 ++ 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c index da141cfa..2310e611 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c @@ -234,10 +234,8 @@ GetCapabilities ( /** This function is to install an SMM Access PPI - Introduction \n -A module to install a PPI for controlling SMM mode memory access basically for S3 resume usage. - - - @result -Publish _EFI_PEI_MM_ACCESS_PPI. +A module to install a PPI for controlling SMM mode memory access basically for S3 resume usage +and publish _EFI_PEI_MM_ACCESS_PPI. @retval EFI_SUCCESS - Ppi successfully started and installed. @retval EFI_NOT_FOUND - Ppi can't be found. diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c index 3d3c4ab2..bdcacac5 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c @@ -18,7 +18,7 @@ static SMM_ACCESS_PRIVATE_DATA mSmmAccess; @param[in] SystemTable - Pointer to the EFI System Table @retval EFI_SUCCESS - Protocol was installed successfully - @exception EFI_UNSUPPORTED- Protocol was not installed + @retval EFI_UNSUPPORTED - Protocol was not installed @retval EFI_NOT_FOUND - Protocol can't be found. @retval EFI_OUT_OF_RESOURCES - Protocol does not have enough resources to initialize the driver. **/ diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h index c0ff3a25..647b3a07 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h @@ -58,9 +58,7 @@ typedef struct { Finally, the SMM access protocol provides services to "Lock" the SMRAM region. Please refer the SMM Protocols section in the attached SMM CIS Specification version 0.9 for further details. This driver is required if SMM is supported. Proper configuration of SMM registers is recommended even if SMM is not supported. - - - @result -Publishes the _EFI_SMM_ACCESS_PROTOCOL: Documented in the System Management Mode Core Interface Specification, available at the URL: http://www.intel.com/technology/framework/spec.htm +This driver publishes the _EFI_SMM_ACCESS_PROTOCOL: Documented in the System Management Mode Core Interface Specification, available at the URL: http://www.intel.com/technology/framework/spec.htm - Porting Recommendations \n No modification of this module is recommended. Any modification should be done in compliance with the _EFI_SMM_ACCESS_PROTOCOL protocol definition. @@ -69,7 +67,7 @@ typedef struct { @param[in] SystemTable - Pointer to the EFI System Table @retval EFI_SUCCESS - Protocol was installed successfully - @exception EFI_UNSUPPORTED - Protocol was not installed + @retval EFI_UNSUPPORTED - Protocol was not installed **/ EFI_STATUS EFIAPI diff --git a/Silicon/Intel/IntelSiliconPkg/Include/Library/SmmAccessLib.h b/Silicon/Intel/IntelSiliconPkg/Include/Library/SmmAccessLib.h index f658bac6..cf99df56 100644 --- a/Silicon/Intel/IntelSiliconPkg/Include/Library/SmmAccessLib.h +++ b/Silicon/Intel/IntelSiliconPkg/Include/Library/SmmAccessLib.h @@ -11,10 +11,8 @@ /** This function is to install an SMM Access PPI - Introduction \n -A module to install a PPI for controlling SMM mode memory access basically for S3 resume usage. - - - @result -Publish _PEI_MM_ACCESS_PPI. +A module to install a PPI for controlling SMM mode memory access basically for S3 resume usage +and publish _PEI_MM_ACCESS_PPI. @retval EFI_SUCCESS - Ppi successfully started and installed. @retval EFI_NOT_FOUND - Ppi can't be found. -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46969): h
[edk2-devel] [PATCH] IntelSiliconPkg/SmmAccess: Update the parameters in comments
Change the order of parameters in comments to match the order in code, in PeiSmmAccessLib.c. Add the attribute "out" for parameters. This is to fix issues reported by ECC. Cc: Ray Ni Cc: Rangasai V Chaganty Signed-off-by: Shenglei Zhang --- .../SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c | 6 +++--- .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c| 4 ++-- .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h| 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c index 2310e611..76b1b23b 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.c @@ -46,9 +46,9 @@ typedef struct { The use of "open" means that the memory is visible from all PEIM and SMM agents. + @param[in] PeiServices - General purpose services available to every PEIM. @param[in] This - Pointer to the SMM Access Interface. @param[in] DescriptorIndex - Region of SMRAM to Open. - @param[in] PeiServices - General purpose services available to every PEIM. @retval EFI_SUCCESS- The region was successfully opened. @retval EFI_DEVICE_ERROR - The region could not be opened because locked by @@ -195,9 +195,9 @@ Lock ( @param[in] PeiServices - General purpose services available to every PEIM. @param[in] This - Pointer to the SMRAM Access Interface. - @param[in] SmramMapSize - Pointer to the variable containing size of the + @param[in,out] SmramMapSize - Pointer to the variable containing size of the buffer to contain the description information. - @param[in] SmramMap - Buffer containing the data describing the Smram + @param[in,out] SmramMap - Buffer containing the data describing the Smram region descriptors. @retval EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient buffer. diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c index bdcacac5..253d8015 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c @@ -229,9 +229,9 @@ Lock ( memory controller capabilities. @param[in] This - Pointer to the SMRAM Access Interface. - @param[in] SmramMapSize - Pointer to the variable containing size of the + @param[in,out] SmramMapSize - Pointer to the variable containing size of the buffer to contain the description information. - @param[in] SmramMap - Buffer containing the data describing the Smram + @param[in,out] SmramMap - Buffer containing the data describing the Smram region descriptors. @retval EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient buffer. diff --git a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h index 647b3a07..c4d881be 100644 --- a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h +++ b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h @@ -140,9 +140,9 @@ Lock ( memory controller capabilities. @param[in] This - Pointer to the SMRAM Access Interface. - @param[in] SmramMapSize - Pointer to the variable containing size of the + @param[in,out] SmramMapSize - Pointer to the variable containing size of the buffer to contain the description information. - @param[in] SmramMap - Buffer containing the data describing the Smram + @param[in,out] SmramMap - Buffer containing the data describing the Smram region descriptors. @retval EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient buffer. -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46970): https://edk2.groups.io/g/devel/message/46970 Mute This Topic: https://groups.io/mt/33164366/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] UserInterfaceFeaturePkg:Remove white ending line in DSC file
Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .../Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc index e97bed53..95c26766 100644 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc +++ b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc @@ -77,4 +77,4 @@ UserInterfaceFeaturePkg/UserAuthentication/UserAuthenticationSmm.inf [BuildOptions] - *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES \ No newline at end of file + *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES \ No newline at end of file -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46972): https://edk2.groups.io/g/devel/message/46972 Mute This Topic: https://groups.io/mt/33164368/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] DebugFeaturePkg: Remove white space and white ending line
Cc: Eric Dong Cc: Liming Gao Signed-off-by: Shenglei Zhang --- Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c | 3 +-- Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c index f9cd8bcb..5ad8d259 100644 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c +++ b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c @@ -487,7 +487,7 @@ InitializeAcpiDebugSmm ( if (EFI_ERROR (Status)) { return Status; } - + Status = SmmBase2->InSmm (SmmBase2, &InSmm); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { @@ -519,4 +519,3 @@ InitializeAcpiDebugSmm ( return Status; } - diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc index 30f57d5d..61046f7a 100644 --- a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc +++ b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc @@ -98,4 +98,4 @@ DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf [BuildOptions] - *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES \ No newline at end of file + *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES \ No newline at end of file -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46973): https://edk2.groups.io/g/devel/message/46973 Mute This Topic: https://groups.io/mt/33164369/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] UserInterfaceFeaturePkg: Update the end of last line
The original the of last line is '/r'. Now update it to '/r/n'. Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: In v1 the patch remove the '/r'. In v2 it is updated to '/r/n'. The v1 patch is "UserInterfaceFeaturePkg:Remove white ending line in DSC file". .../Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc index e97bed53..6c5f77b5 100644 --- a/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc +++ b/Platform/Intel/UserInterfaceFeaturePkg/UserInterfaceFeaturePkg.dsc @@ -77,4 +77,4 @@ UserInterfaceFeaturePkg/UserAuthentication/UserAuthenticationSmm.inf [BuildOptions] - *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES \ No newline at end of file + *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46982): https://edk2.groups.io/g/devel/message/46982 Mute This Topic: https://groups.io/mt/33169035/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] DebugFeaturePkg: Remove white space and update the ending format
Remove white space in AcpiDebug.c. The original end of last line in DebugFeaturePkg.dsc is '/r'. Now update it to '/r/n'. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: In v1 the patch remove the '/r'. In v2 it is updated to '/r/n'. The v1 patch is "DebugFeaturePkg: Remove white space and white ending line". Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c | 3 +-- Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c index f9cd8bcb..5ad8d259 100644 --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c +++ b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c @@ -487,7 +487,7 @@ InitializeAcpiDebugSmm ( if (EFI_ERROR (Status)) { return Status; } - + Status = SmmBase2->InSmm (SmmBase2, &InSmm); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { @@ -519,4 +519,3 @@ InitializeAcpiDebugSmm ( return Status; } - diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc index 30f57d5d..8e5ff4c9 100644 --- a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc +++ b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc @@ -98,4 +98,4 @@ DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf [BuildOptions] - *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES \ No newline at end of file + *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46983): https://edk2.groups.io/g/devel/message/46983 Mute This Topic: https://groups.io/mt/33169036/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] BoardModulePkg/CmosAccessLib: Update the end of last line
The original end of last line is '/r'. Now update it to '/r/n'. Cc: Eric Dong Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: In v1 the patch remove the '/r'. In v2 it is updated to '/r/n'. The v1 patch is "BoardModulePkg/CmosAccessLib: Remove white ending line". .../BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf index 77ea219f..f84d6d1a 100644 --- a/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf +++ b/Platform/Intel/BoardModulePkg/Library/CmosAccessLib/CmosAccessLib.inf @@ -25,4 +25,4 @@ [Packages] MdePkg/MdePkg.dec - BoardModulePkg/BoardModulePkg.dec \ No newline at end of file + BoardModulePkg/BoardModulePkg.dec -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#46981): https://edk2.groups.io/g/devel/message/46981 Mute This Topic: https://groups.io/mt/33169033/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] BaseTools/LzmaCompress: Add two switches
As is requested in the BZ 2077, add two switches to support setting compression mode and dictionary size. (https://bugzilla.tianocore.org/show_bug.cgi?id=2077) Cc: Bob Feng Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .../Source/C/LzmaCompress/LzmaCompress.c | 39 +++ BaseTools/Source/C/LzmaCompress/Makefile | 4 +- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c index a3607f9b2084..e18a1e0365f6 100644 --- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c +++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c @@ -5,7 +5,7 @@ LzmaUtil.c -- Test application for LZMA compression 2018-04-30 : Igor Pavlov : Public domain - Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -23,6 +23,7 @@ #include "Sdk/C/LzmaEnc.h" #include "Sdk/C/Bra.h" #include "CommonLib.h" +#include "ParseInf.h" #define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8) @@ -36,10 +37,14 @@ const char *kCantReadMessage = "Can not read input file"; const char *kCantWriteMessage = "Can not write output file"; const char *kCantAllocateMessage = "Can not allocate memory"; const char *kDataErrorMessage = "Data error"; +const char *kInvalidParamValMessage = "Invalid parameter value"; static Bool mQuietMode = False; static CONVERTER_TYPE mConType = NoConverter; +UINT64 DictionarySize = 31; +UINT64 CompressionMode = 2; + #define UTILITY_NAME "LzmaCompress" #define UTILITY_MAJOR_VERSION 0 #define UTILITY_MINOR_VERSION 2 @@ -58,6 +63,8 @@ void PrintHelp(char *buffer) " -v, --verbose: increase output messages\n" " -q, --quiet: reduce output messages\n" " --debug [0-9]: set debug level\n" + " -a: set compression mode 0 = fast, 1 = normal, default: 1 (normal)\n" + " d: sets Dictionary size - [0, 30], default: 23 (8MB)\n" " --version: display the program version and exit\n" " -h, --help: display this help text\n" ); @@ -87,7 +94,7 @@ void PrintVersion(char *buffer) sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION); } -static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize) +static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize, CLzmaEncProps props) { SRes res; size_t inSize = (size_t)fileSize; @@ -95,10 +102,6 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file Byte *outBuffer = 0; Byte *filteredStream = 0; size_t outSize; - CLzmaEncProps props; - - LzmaEncProps_Init(&props); - LzmaEncProps_Normalize(&props); if (inSize != 0) { inBuffer = (Byte *)MyAlloc(inSize); @@ -246,6 +249,10 @@ int main2(int numArgs, const char *args[], char *rs) const char *outputFile = "file.tmp"; int param; UInt64 fileSize; + CLzmaEncProps props; + + LzmaEncProps_Init(&props); + LzmaEncProps_Normalize(&props); FileSeqInStream_CreateVTable(&inStream); File_Construct(&inStream.file); @@ -280,6 +287,24 @@ int main2(int numArgs, const char *args[], char *rs) // parameter compatibility with other build tools. // param++; +} else if (strcmp(args[param], "-a") == 0) { + AsciiStringToUint64(args[param + 1],FALSE,&CompressionMode); + if ((CompressionMode == 0)||(CompressionMode == 1)){ +props.algo = (int)CompressionMode; + param++; +continue; + } else { +return PrintError(rs, kInvalidParamValMessage); + } +} else if (strcmp(args[param], "d") == 0) { + AsciiStringToUint64(args[param + 1],FALSE,&DictionarySize); + if ((DictionarySize >= 0)&&(DictionarySize <= 30)){ +props.dictSize = (UINT32)DictionarySize; + param++; +continue; + } else { +return PrintError(rs, kInvalidParamValMessage); + } } else if ( strcmp(args[param], "-h") == 0 || strcmp(args[param], "--help") == 0 @@ -335,7 +360,7 @@ int main2(int numArgs, const char *args[], char *rs) if (!mQuietMode) { printf("Encoding\n"); } -res = Encode(&outStream.vt, &inStream.vt, fileSize); +res = Encode(&outStream.vt, &inStream.vt, fileSize, props); } else { diff --git a/BaseTools/Source/C/LzmaCompress/Makefile b/BaseTools/Source/C/LzmaCompress/Makefile index 12be48de2940..055f5d3ac3ca 100644 --- a/BaseTools/Source/C/LzmaCompress/Makefile +++ b/BaseTools/Source/C/LzmaCompress/Makefile @@ -1,14 +1,14 @@ ## @file # Windows makefile for 'LzmaCompress' module build. # -# Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. +# Copyright (c) 2009 - 2019, Intel Corporation. All rights
[edk2-devel] [PATCH] MinPlatformPkg/TestPointCheckLib: Add check for pointers
In DxeCheckBootVariable.c, add check for BootOrder and Variable that return EFI_NOT_FOUND when they are NULL. In DxeCheckGcd.c, add check for GcdIoMap to ensure it not NULL when allocating memory to what it points to. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: Update copyright .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 8 +++- .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 6 -- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c index 85bd5b3d..98130683 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -130,6 +130,9 @@ TestPointCheckLoadOptionVariable ( for (ListIndex = 0; ListIndex < sizeof(mLoadOptionVariableList)/sizeof(mLoadOptionVariableList[0]); ListIndex++) { UnicodeSPrint (BootOrderName, sizeof(BootOrderName), L"%sOrder", mLoadOptionVariableList[ListIndex]); Status = GetVariable2 (BootOrderName, &gEfiGlobalVariableGuid, (VOID **)&BootOrder, &OrderSize); +if(BootOrder == NULL) { + return EFI_NOT_FOUND;; +} if (EFI_ERROR(Status)) { continue; } @@ -222,6 +225,9 @@ TestPointCheckKeyOptionVariable ( for (Index = 0; ; Index++) { UnicodeSPrint (KeyOptionName, sizeof(KeyOptionName), L"%s%04x", mKeyOptionVariableList[ListIndex], Index); Status = GetVariable2 (KeyOptionName, &gEfiGlobalVariableGuid, &Variable, &Size); + if(Variable == NULL) { +return EFI_NOT_FOUND;; + } if (!EFI_ERROR(Status)) { DumpKeyOption (KeyOptionName, Variable, Size); } else { diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c index 82709d44..c90b37f2 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -241,7 +241,9 @@ TestPointDumpGcd ( } } if (GcdMemoryMap != NULL) { - *GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + if (GcdIoMap != NULL){ +*GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + } *GcdIoMapNumberOfDescriptors = NumberOfDescriptors; } } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47157): https://edk2.groups.io/g/devel/message/47157 Mute This Topic: https://groups.io/mt/33110621/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 1/2] MinPlatformPkg/AcpiTables: Initialize variables before used
MadtStructs, NewMadtTable and MaxMadtStructCount are not initialized before used or at the proper place. So assign values to them at the beginning and change the logic when freeing MadtStructs and NewMadtTable. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .../Acpi/AcpiTables/AcpiPlatform.c| 21 +++ 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index 5eb72792..2cc55ee8 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -1,7 +1,7 @@ /** @file ACPI Platform Driver -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -867,13 +867,15 @@ InstallMadtFromScratch ( UINT32 PcIoApicMask; UINTN PcIoApicIndex; + MadtStructs = NULL; + NewMadtTable = NULL; + MaxMadtStructCount = 0; + DetectApicIdMap(); // Call for Local APIC ID Reorder SortCpuLocalApicInTable (); - NewMadtTable = NULL; - MaxMadtStructCount = (UINT32) ( MAX_CPU_NUM +// processor local APIC structures MAX_CPU_NUM +// processor local x2APIC structures @@ -1115,14 +1117,15 @@ Done: // // Free memory // - for (MadtStructsIndex = 0; MadtStructsIndex < MaxMadtStructCount; MadtStructsIndex++) { -if (MadtStructs[MadtStructsIndex] != NULL) { - FreePool (MadtStructs[MadtStructsIndex]); + if (MadtStructs != NULL){ +for (MadtStructsIndex = 0; MadtStructsIndex < MaxMadtStructCount; MadtStructsIndex++) { + if (MadtStructs[MadtStructsIndex] != NULL) { +FreePool (MadtStructs[MadtStructsIndex]); + } } +FreePool (MadtStructs); } - - FreePool (MadtStructs); - + if (NewMadtTable != NULL) { FreePool (NewMadtTable); } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47163): https://edk2.groups.io/g/devel/message/47163 Mute This Topic: https://groups.io/mt/34111552/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 0/2] Add error handling and initialize variables
1.Add error handling to enhance status checking. 2.Initialize the variables before used and add check before FreePool(). v2: Update copyright in 01/02. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Shenglei Zhang (2): MinPlatformPkg/AcpiTables: Initialize variables before used MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable .../Acpi/AcpiTables/AcpiPlatform.c| 29 --- 1 file changed, 18 insertions(+), 11 deletions(-) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47162): https://edk2.groups.io/g/devel/message/47162 Mute This Topic: https://groups.io/mt/34111550/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 2/2] MinPlatformPkg/AcpiTables: Add error handling to SortCpuLocalApicInTable
Change ASSERT_EFI_ERROR to return value when the "if" statement is true. As a result, when SortCpuLocalApicInTable is called, error handling is needed. So add "if" statement to judge the returned Status from SortCpuLocalApicInTable () in function InstallMadtFromScratch(). Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .../Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index 2cc55ee8..ae25d753 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -354,7 +354,7 @@ SortCpuLocalApicInTable ( if(MAX_CPU_NUM <= Index) { DEBUG ((EFI_D_ERROR, "Asserting the SortCpuLocalApicInTable Index Bufferflow\n")); -ASSERT_EFI_ERROR(EFI_INVALID_PARAMETER); +return EFI_INVALID_PARAMETER; } TempVal = mCpuApicIdOrderTable[Index].ApicId; @@ -874,7 +874,11 @@ InstallMadtFromScratch ( DetectApicIdMap(); // Call for Local APIC ID Reorder - SortCpuLocalApicInTable (); + Status = SortCpuLocalApicInTable (); + if (EFI_ERROR (Status)) { +DEBUG ((EFI_D_ERROR, "SortCpuLocalApicInTable failed: %r\n", Status)); +goto Done; + } MaxMadtStructCount = (UINT32) ( MAX_CPU_NUM +// processor local APIC structures -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47164): https://edk2.groups.io/g/devel/message/47164 Mute This Topic: https://groups.io/mt/34111553/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return value when OutTable is NULL
Currently there is no check for the parameter OutTable. So add the logic that return value EFI_INVALID_PARAMETER when the OutTable is NULL. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2:Update the copyright and the if...else statement coding style. .../Test/Library/TestPointCheckLib/DxeCheckAcpi.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c index 263781a2..83736bf3 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckAcpi.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -610,6 +610,8 @@ DumpAcpiRsdt ( if (OutTable != NULL) { *OutTable = NULL; + } else{ +return EFI_INVALID_PARAMETER; } ReturnStatus = EFI_SUCCESS; @@ -663,6 +665,8 @@ DumpAcpiXsdt ( if (OutTable != NULL) { *OutTable = NULL; + } else{ +return EFI_INVALID_PARAMETER; } ReturnStatus = EFI_SUCCESS; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47243): https://edk2.groups.io/g/devel/message/47243 Mute This Topic: https://groups.io/mt/34159564/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return value when OutTable is NULL
Hi Nathaniel, Thanks for your comments and below is my response. > -Original Message- > From: Desimone, Nathaniel L > Sent: Tuesday, September 17, 2019 3:25 AM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Gao, Liming > Subject: RE: [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return > value when OutTable is NULL > > Hi Shenglei, > > I don't see how this patch is at all related to the previous version of this > patch. What is different from the previous version is that this patch update the copyright year and the "if...else" coding style. > Also, you are introducing yet another new bug with this patch. Moreover, > this bug is unrelated to the previous bug. > > Please take a look at the function TestPointGetAcpi(). With your change > added, this function is now broken since Table is a stack variable and it is > not > being initialized to zero. This function assumes that > DumpAcpiXsdt()/DumpAcpiRsdt() will do the initialization to zero on it's > behalf, you have broken this assumption with your change. I have taken a look at the function TestPointGetAcpi(). The variable Table is first initialized to NULL by DumpAcpiXsdt()/DumpAcpiRsdt(). The reference code is "*OutTable = NULL"(line 667). And it will be assigned a value next. The reference code is "*OutTable = Table"(line 689). And with my changes, the stack variable Table(equivalent to *OutTable in DumpAcpiXsdt/ DumpAcpiRsdt) can still be initialized to NULL or assigned a value. What I did is intended to check the address of "Table", since there is no point to perform operations to "Table" if its address is NULL. Thanks, Shenglei > > Both this patch and the previous patch have been made carelessly and I am > not impressed. > > Thanks, > Nate > > -Original Message- > From: Zhang, Shenglei > Sent: Sunday, September 15, 2019 6:09 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming > Subject: [PATCH v2] MinPlatformPkg/TestPointCheckLib: Add return value > when OutTable is NULL > > Currently there is no check for the parameter OutTable. > So add the logic that return value EFI_INVALID_PARAMETER when the > OutTable is NULL. > > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Signed-off-by: Shenglei Zhang > --- > > v2:Update the copyright and the if...else statement coding style. > > .../Test/Library/TestPointCheckLib/DxeCheckAcpi.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Acpi.c > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Acpi.c > index 263781a2..83736bf3 100644 > --- > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Acpi.c > +++ > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh > +++ eckAcpi.c > @@ -1,6 +1,6 @@ > /** @file > > -Copyright (c) 2017, Intel Corporation. All rights reserved. > +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -610,6 +610,8 @@ DumpAcpiRsdt ( > >if (OutTable != NULL) { > *OutTable = NULL; > + } else{ > +return EFI_INVALID_PARAMETER; >} > >ReturnStatus = EFI_SUCCESS; > @@ -663,6 +665,8 @@ DumpAcpiXsdt ( > >if (OutTable != NULL) { > *OutTable = NULL; > + } else{ > +return EFI_INVALID_PARAMETER; >} > >ReturnStatus = EFI_SUCCESS; > -- > 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47322): https://edk2.groups.io/g/devel/message/47322 Mute This Topic: https://groups.io/mt/34159564/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MinPlatformPkg/TestPointCheckLib: Add check for pointers
Hi Nathaniel, > -Original Message- > From: Desimone, Nathaniel L > Sent: Saturday, September 14, 2019 6:31 AM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Gao, Liming > Subject: Re: [edk2-devel] [PATCH] MinPlatformPkg/TestPointCheckLib: Add > check for pointers > > Hi Shenglei, > > Looking at this patch more closely. There appear to be bugs... please > see below. Please fix this along with your poor use of semi-colons and > white-space. > > Thanks, > > Nate > > On 9/12/2019 11:54 AM, Nate DeSimone wrote: > > Your whitespace doesn't quite match the edk2 coding style guidelines, but > we can fix that during commit. > > > > Reviewed-by: Nate DeSimone > > > > -Original Message- > > From: Zhang, Shenglei > > Sent: Wednesday, September 11, 2019 7:55 PM > > To: devel@edk2.groups.io > > Cc: Kubacki, Michael A ; Chiu, Chasel > ; Desimone, Nathaniel L > ; Gao, Liming > > Subject: [PATCH] MinPlatformPkg/TestPointCheckLib: Add check for > pointers > > > > In DxeCheckBootVariable.c, add check for BootOrder and Variable that > return EFI_NOT_FOUND when they are NULL. > > In DxeCheckGcd.c, add check for GcdIoMap to ensure it not NULL when > allocating memory to what it points to. > > > > Cc: Michael Kubacki > > Cc: Chasel Chiu > > Cc: Nate DeSimone > > Cc: Liming Gao > > Signed-off-by: Shenglei Zhang > > --- > > > > v2: Update copyright > > > > .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 8 +++- > > .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 6 -- > > 2 files changed, 11 insertions(+), 3 deletions(-) > > > > diff --git > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > BootVariable.c > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > BootVariable.c > > index 85bd5b3d..98130683 100644 > > --- > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > BootVariable.c > > +++ > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh > > +++ eckBootVariable.c > > @@ -1,6 +1,6 @@ > > /** @file > > > > -Copyright (c) 2017, Intel Corporation. All rights reserved. > > +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -130,6 +130,9 @@ TestPointCheckLoadOptionVariable ( > > for (ListIndex = 0; ListIndex < > sizeof(mLoadOptionVariableList)/sizeof(mLoadOptionVariableList[0]); > ListIndex++) { > > UnicodeSPrint (BootOrderName, sizeof(BootOrderName), L"%sOrder", > mLoadOptionVariableList[ListIndex]); > > Status = GetVariable2 (BootOrderName, &gEfiGlobalVariableGuid, > (VOID **)&BootOrder, &OrderSize); > > +if(BootOrder == NULL) { > > + return EFI_NOT_FOUND;; > > +} > > if (EFI_ERROR(Status)) { > > continue; > > } > > @@ -222,6 +225,9 @@ TestPointCheckKeyOptionVariable ( > > for (Index = 0; ; Index++) { > > UnicodeSPrint (KeyOptionName, sizeof(KeyOptionName), L"%s%04x", > mKeyOptionVariableList[ListIndex], Index); > > Status = GetVariable2 (KeyOptionName, &gEfiGlobalVariableGuid, > &Variable, &Size); > > + if(Variable == NULL) { > > +return EFI_NOT_FOUND;; > > + } > > if (!EFI_ERROR(Status)) { > > DumpKeyOption (KeyOptionName, Variable, Size); > > } else { > > diff --git > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Gcd.c > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Gcd.c > > index 82709d44..c90b37f2 100644 > > --- > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheck > Gcd.c > > +++ > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh > > +++ eckGcd.c > > @@ -1,6 +1,6 @@ > > /** @file > > > > -Copyright (c) 2017, Intel Corporation. All rights reserved. > > +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -241,7 +241,9 @@ TestPointDumpGcd ( > > } > > } > > if (GcdMemoryMap != NULL) { > > - *GcdIoMap = AllocateCopyPool (NumberOfDescriptors * > sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); > > + if (GcdIoMap != NULL){ > > +*GcdIoMap = AllocateCopyP
[edk2-devel] [PATCH v2] BaseTools/LzmaCompress: Add two switches
As is requested in the BZ 2077, add two switches to support setting compression mode and dictionary size. (https://bugzilla.tianocore.org/show_bug.cgi?id=2077) Cc: Bob Feng Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: 1.Update DictionarySize to mDictionarySize. 2.Update CompressionMode to mCompressionMode. 3.Use CLzmaEncProps *props as the input parameter of the function Encode. .../Source/C/LzmaCompress/LzmaCompress.c | 43 +++ BaseTools/Source/C/LzmaCompress/GNUmakefile | 4 +- BaseTools/Source/C/LzmaCompress/Makefile | 4 +- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c index a3607f9b2084..e784318d9829 100644 --- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c +++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c @@ -5,7 +5,7 @@ LzmaUtil.c -- Test application for LZMA compression 2018-04-30 : Igor Pavlov : Public domain - Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -23,6 +23,7 @@ #include "Sdk/C/LzmaEnc.h" #include "Sdk/C/Bra.h" #include "CommonLib.h" +#include "ParseInf.h" #define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8) @@ -36,10 +37,14 @@ const char *kCantReadMessage = "Can not read input file"; const char *kCantWriteMessage = "Can not write output file"; const char *kCantAllocateMessage = "Can not allocate memory"; const char *kDataErrorMessage = "Data error"; +const char *kInvalidParamValMessage = "Invalid parameter value"; static Bool mQuietMode = False; static CONVERTER_TYPE mConType = NoConverter; +UINT64 mDictionarySize = 31; +UINT64 mCompressionMode = 2; + #define UTILITY_NAME "LzmaCompress" #define UTILITY_MAJOR_VERSION 0 #define UTILITY_MINOR_VERSION 2 @@ -58,6 +63,8 @@ void PrintHelp(char *buffer) " -v, --verbose: increase output messages\n" " -q, --quiet: reduce output messages\n" " --debug [0-9]: set debug level\n" + " -a: set compression mode 0 = fast, 1 = normal, default: 1 (normal)\n" + " d: sets Dictionary size - [0, 30], default: 23 (8MB)\n" " --version: display the program version and exit\n" " -h, --help: display this help text\n" ); @@ -87,7 +94,7 @@ void PrintVersion(char *buffer) sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION); } -static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize) +static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize, CLzmaEncProps *props) { SRes res; size_t inSize = (size_t)fileSize; @@ -95,10 +102,6 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file Byte *outBuffer = 0; Byte *filteredStream = 0; size_t outSize; - CLzmaEncProps props; - - LzmaEncProps_Init(&props); - LzmaEncProps_Normalize(&props); if (inSize != 0) { inBuffer = (Byte *)MyAlloc(inSize); @@ -151,7 +154,7 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file res = LzmaEncode(outBuffer + LZMA_HEADER_SIZE, &outSizeProcessed, mConType != NoConverter ? filteredStream : inBuffer, inSize, -&props, outBuffer, &outPropsSize, 0, +props, outBuffer, &outPropsSize, 0, NULL, &g_Alloc, &g_Alloc); if (res != SZ_OK) @@ -246,6 +249,12 @@ int main2(int numArgs, const char *args[], char *rs) const char *outputFile = "file.tmp"; int param; UInt64 fileSize; + CLzmaEncProps *props; + + props = (CLzmaEncProps *)AllocateZeroPool(sizeof(CLzmaEncProps)); + + LzmaEncProps_Init(props); + LzmaEncProps_Normalize(props); FileSeqInStream_CreateVTable(&inStream); File_Construct(&inStream.file); @@ -280,6 +289,24 @@ int main2(int numArgs, const char *args[], char *rs) // parameter compatibility with other build tools. // param++; +} else if (strcmp(args[param], "-a") == 0) { + AsciiStringToUint64(args[param + 1],FALSE,&mCompressionMode); + if ((mCompressionMode == 0)||(mCompressionMode == 1)){ +props->algo = (int)mCompressionMode; +param++; +continue; + } else { +return PrintError(rs, kInvalidParamValMessage); + } +} else if (strcmp(args[param], "d") == 0) { + AsciiStringToUint64(args[param + 1],FALSE,&mDictionarySize); + if ((mDictionarySize >= 0)&&(mDictionarySize <= 30)){ +props->dictSize = (UINT32)mDictionarySize; +param++; +continue; + } else { +return PrintError(rs, kInvalidParamValMessage); + } } else if ( strcmp(args[param], "-h") == 0 || strcmp(args[param], "--help") == 0 @@ -335,7 +362
Re: [edk2-devel] [PATCH V2 0/3] MdeModulePkg/TerminalConsole: Extend the support terminal types
Hi Ard, That's my mistake to push the broken patch(0d85e67714e31e0dbe4241ab2ebb7c423aba174d). This patch only updates the file guid, which I thought has no risk. So I didn’t check the build result. I should double check the new guid used in the file. Liming has help send a patch to fix this issue. Thanks, Shenglei > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Ard Biesheuvel > Sent: Tuesday, September 17, 2019 2:29 PM > To: Gao, Zhichao > Cc: edk2-devel-groups-io ; Wang, Jian J > ; Wu, Hao A ; Ni, Ray > ; Laszlo Ersek ; Gao, Liming > > Subject: Re: [edk2-devel] [PATCH V2 0/3] MdeModulePkg/TerminalConsole: > Extend the support terminal types > > On Tue, 17 Sep 2019 at 07:22, Gao, Zhichao wrote: > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186 > > > > Putty is a very popular terminal tool in windows. So add the whole support > > terminal keyboard type for it. The new introduced type is Linux, XtermR6, > > VT400 and SCO. And enhance the support for VT100+. > > This patch set only add the support of function key. Refer to the link: > > https://www.ssh.com/ssh/putty/putty- > manuals/0.68/Chapter4.html#config-funkeys > > > > V2: > > Fix typo. > > Merge the type guid defination into TtyTerm.h. > > > > Hello Zhichao, > > Since you already pushed the broken patch, you should really be > posting an updated patch with just the fix. > > In any case, this makes me wonder how you tested this code, since it > won't even build. Could you elaborate? > > -- > Ard. > > > > Cc: Jian J Wang > > Cc: Hao A Wu > > Cc: Ray Ni > > Cc: Ard Biesheuvel > > Cc: Laszlo Ersek > > Cc: Liming Gao > > Signed-of-by: Zhichao Gao > > > > Zhichao Gao (3): > > MdeModulePkg: Extend the support keyboard type of Terminal console > > MdeModulePkg/TerminalDxe: Extend the terminal console support types > > MdeModulePkg/BM_UI: Add the new terminal types to related menu > > > > MdeModulePkg/Include/Guid/TtyTerm.h | 13 + > > .../BootMaintenanceManager.h | 12 +- > > .../BootMaintenanceManagerStrings.uni | 10 +- > > .../ConsoleOption.c | 35 +-- > > .../BootMaintenanceManagerUiLib/Data.c| 16 +- > > MdeModulePkg/MdeModulePkg.dec | 4 + > > .../Universal/Console/TerminalDxe/Terminal.c | 17 +- > > .../Universal/Console/TerminalDxe/Terminal.h | 37 ++- > > .../Console/TerminalDxe/TerminalConIn.c | 281 -- > > .../Console/TerminalDxe/TerminalConOut.c | 4 + > > .../Console/TerminalDxe/TerminalDxe.inf | 6 +- > > 11 files changed, 375 insertions(+), 60 deletions(-) > > > > -- > > 2.21.0.windows.1 > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47353): https://edk2.groups.io/g/devel/message/47353 Mute This Topic: https://groups.io/mt/34173528/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3] MinPlatformPkg/TestPointCheckLib: Add check for pointers
In DxeCheckBootVariable.c, add check for BootOrder and Variable that return EFI_NOT_FOUND when they are NULL. In DxeCheckGcd.c, add check for GcdIoMap to ensure it not NULL when allocating memory to what it points to. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: Update copyright v3: Fix the coding style. .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 8 +++- .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 8 +--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c index 85bd5b3d..f658beb7 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -130,6 +130,9 @@ TestPointCheckLoadOptionVariable ( for (ListIndex = 0; ListIndex < sizeof(mLoadOptionVariableList)/sizeof(mLoadOptionVariableList[0]); ListIndex++) { UnicodeSPrint (BootOrderName, sizeof(BootOrderName), L"%sOrder", mLoadOptionVariableList[ListIndex]); Status = GetVariable2 (BootOrderName, &gEfiGlobalVariableGuid, (VOID **)&BootOrder, &OrderSize); +if(BootOrder == NULL) { + return EFI_NOT_FOUND; +} if (EFI_ERROR(Status)) { continue; } @@ -222,6 +225,9 @@ TestPointCheckKeyOptionVariable ( for (Index = 0; ; Index++) { UnicodeSPrint (KeyOptionName, sizeof(KeyOptionName), L"%s%04x", mKeyOptionVariableList[ListIndex], Index); Status = GetVariable2 (KeyOptionName, &gEfiGlobalVariableGuid, &Variable, &Size); + if(Variable == NULL) { +return EFI_NOT_FOUND; + } if (!EFI_ERROR(Status)) { DumpKeyOption (KeyOptionName, Variable, Size); } else { diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c index 82709d44..28ca8382 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -241,11 +241,13 @@ TestPointDumpGcd ( } } if (GcdMemoryMap != NULL) { - *GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + if (GcdIoMap != NULL) { +*GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + } *GcdIoMapNumberOfDescriptors = NumberOfDescriptors; } } - + if (DumpPrint) { DEBUG ((DEBUG_INFO, " TestPointDumpGcd - Exit\n")); } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47441): https://edk2.groups.io/g/devel/message/47441 Mute This Topic: https://groups.io/mt/34183382/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v4] MinPlatformPkg/TestPointCheckLib: Add check for pointers
In DxeCheckBootVariable.c, add check for BootOrder and Variable that return EFI_NOT_FOUND when they are NULL. In DxeCheckGcd.c, add check for GcdIoMap to ensure it not NULL when allocating memory to what it points to. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: Update copyright v3: Fix the coding style. v4: Update the logic in DxeCheckBootVariable.c. We directly return when BootOrder/Variable == NULL, in previous versions. .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 6 +++--- .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 8 +--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c index 85bd5b3d..06a40505 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -130,7 +130,7 @@ TestPointCheckLoadOptionVariable ( for (ListIndex = 0; ListIndex < sizeof(mLoadOptionVariableList)/sizeof(mLoadOptionVariableList[0]); ListIndex++) { UnicodeSPrint (BootOrderName, sizeof(BootOrderName), L"%sOrder", mLoadOptionVariableList[ListIndex]); Status = GetVariable2 (BootOrderName, &gEfiGlobalVariableGuid, (VOID **)&BootOrder, &OrderSize); -if (EFI_ERROR(Status)) { +if (EFI_ERROR(Status)||(BootOrder == NULL)) { continue; } for (Index = 0; Index < OrderSize/sizeof(CHAR16); Index++) { @@ -222,7 +222,7 @@ TestPointCheckKeyOptionVariable ( for (Index = 0; ; Index++) { UnicodeSPrint (KeyOptionName, sizeof(KeyOptionName), L"%s%04x", mKeyOptionVariableList[ListIndex], Index); Status = GetVariable2 (KeyOptionName, &gEfiGlobalVariableGuid, &Variable, &Size); - if (!EFI_ERROR(Status)) { + if (!EFI_ERROR(Status)&&(Variable != NULL)) { DumpKeyOption (KeyOptionName, Variable, Size); } else { break; diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c index 82709d44..28ca8382 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017-2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -241,11 +241,13 @@ TestPointDumpGcd ( } } if (GcdMemoryMap != NULL) { - *GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + if (GcdIoMap != NULL) { +*GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + } *GcdIoMapNumberOfDescriptors = NumberOfDescriptors; } } - + if (DumpPrint) { DEBUG ((DEBUG_INFO, " TestPointDumpGcd - Exit\n")); } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47460): https://edk2.groups.io/g/devel/message/47460 Mute This Topic: https://groups.io/mt/34185180/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3] BaseTools/LzmaCompress: Add two switches
From: "Zhang, Shenglei" As is requested in the BZ 2077, add two switches to support setting compression mode and dictionary size. (https://bugzilla.tianocore.org/show_bug.cgi?id=2077) Cc: Bob Feng Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: 1.Update DictionarySize to mDictionarySize. 2.Update CompressionMode to mCompressionMode. 3.Use CLzmaEncProps *props as the input parameter of the function Encode. v3: Remove the component "mDictionarySize >= 0" in the if judgement.line 303 This is to fix the build failure under Mac OS. Beacuse the type of mDictionarySize is UINT64, which is always >= 0. .../Source/C/LzmaCompress/LzmaCompress.c | 43 +++ BaseTools/Source/C/LzmaCompress/GNUmakefile | 4 +- BaseTools/Source/C/LzmaCompress/Makefile | 4 +- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c index a3607f9b2084..328ecfa930da 100644 --- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c +++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c @@ -5,7 +5,7 @@ LzmaUtil.c -- Test application for LZMA compression 2018-04-30 : Igor Pavlov : Public domain - Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -23,6 +23,7 @@ #include "Sdk/C/LzmaEnc.h" #include "Sdk/C/Bra.h" #include "CommonLib.h" +#include "ParseInf.h" #define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8) @@ -36,10 +37,14 @@ const char *kCantReadMessage = "Can not read input file"; const char *kCantWriteMessage = "Can not write output file"; const char *kCantAllocateMessage = "Can not allocate memory"; const char *kDataErrorMessage = "Data error"; +const char *kInvalidParamValMessage = "Invalid parameter value"; static Bool mQuietMode = False; static CONVERTER_TYPE mConType = NoConverter; +UINT64 mDictionarySize = 31; +UINT64 mCompressionMode = 2; + #define UTILITY_NAME "LzmaCompress" #define UTILITY_MAJOR_VERSION 0 #define UTILITY_MINOR_VERSION 2 @@ -58,6 +63,8 @@ void PrintHelp(char *buffer) " -v, --verbose: increase output messages\n" " -q, --quiet: reduce output messages\n" " --debug [0-9]: set debug level\n" + " -a: set compression mode 0 = fast, 1 = normal, default: 1 (normal)\n" + " d: sets Dictionary size - [0, 30], default: 23 (8MB)\n" " --version: display the program version and exit\n" " -h, --help: display this help text\n" ); @@ -87,7 +94,7 @@ void PrintVersion(char *buffer) sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION); } -static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize) +static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize, CLzmaEncProps *props) { SRes res; size_t inSize = (size_t)fileSize; @@ -95,10 +102,6 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file Byte *outBuffer = 0; Byte *filteredStream = 0; size_t outSize; - CLzmaEncProps props; - - LzmaEncProps_Init(&props); - LzmaEncProps_Normalize(&props); if (inSize != 0) { inBuffer = (Byte *)MyAlloc(inSize); @@ -151,7 +154,7 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file res = LzmaEncode(outBuffer + LZMA_HEADER_SIZE, &outSizeProcessed, mConType != NoConverter ? filteredStream : inBuffer, inSize, -&props, outBuffer, &outPropsSize, 0, +props, outBuffer, &outPropsSize, 0, NULL, &g_Alloc, &g_Alloc); if (res != SZ_OK) @@ -246,6 +249,12 @@ int main2(int numArgs, const char *args[], char *rs) const char *outputFile = "file.tmp"; int param; UInt64 fileSize; + CLzmaEncProps *props; + + props = (CLzmaEncProps *)AllocateZeroPool(sizeof(CLzmaEncProps)); + + LzmaEncProps_Init(props); + LzmaEncProps_Normalize(props); FileSeqInStream_CreateVTable(&inStream); File_Construct(&inStream.file); @@ -280,6 +289,24 @@ int main2(int numArgs, const char *args[], char *rs) // parameter compatibility with other build tools. // param++; +} else if (strcmp(args[param], "-a") == 0) { + AsciiStringToUint64(args[param + 1],FALSE,&mCompressionMode); + if ((mCompressionMode == 0)||(mCompressionMode == 1)){ +props->algo = (int)mCompressionMode; +param++; +continue; + } else { +return PrintError(rs, k
[edk2-devel] [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: Add check for pointers
In DxeCheckBootVariable.c, add check for BootOrder and Variable that return EFI_NOT_FOUND when they are NULL. In DxeCheckGcd.c, add check for GcdIoMap to ensure it not NULL when allocating memory to what it points to. Cc: Michael Kubacki Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: Update copyright v3: Fix the coding style. v4: Update the logic in DxeCheckBootVariable.c. We directly return when BootOrder/Variable == NULL, in previous versions. v5: Update the format of copyright and the coding style. .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 6 +++--- .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 8 +--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c index 85bd5b3d..5437cf6a 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -130,7 +130,7 @@ TestPointCheckLoadOptionVariable ( for (ListIndex = 0; ListIndex < sizeof(mLoadOptionVariableList)/sizeof(mLoadOptionVariableList[0]); ListIndex++) { UnicodeSPrint (BootOrderName, sizeof(BootOrderName), L"%sOrder", mLoadOptionVariableList[ListIndex]); Status = GetVariable2 (BootOrderName, &gEfiGlobalVariableGuid, (VOID **)&BootOrder, &OrderSize); -if (EFI_ERROR(Status)) { +if (EFI_ERROR(Status) || (BootOrder == NULL)) { continue; } for (Index = 0; Index < OrderSize/sizeof(CHAR16); Index++) { @@ -222,7 +222,7 @@ TestPointCheckKeyOptionVariable ( for (Index = 0; ; Index++) { UnicodeSPrint (KeyOptionName, sizeof(KeyOptionName), L"%s%04x", mKeyOptionVariableList[ListIndex], Index); Status = GetVariable2 (KeyOptionName, &gEfiGlobalVariableGuid, &Variable, &Size); - if (!EFI_ERROR(Status)) { + if (!EFI_ERROR(Status) && (Variable != NULL)) { DumpKeyOption (KeyOptionName, Variable, Size); } else { break; diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c index 82709d44..066121c7 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckGcd.c @@ -1,6 +1,6 @@ /** @file -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -241,11 +241,13 @@ TestPointDumpGcd ( } } if (GcdMemoryMap != NULL) { - *GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + if (GcdIoMap != NULL) { +*GcdIoMap = AllocateCopyPool (NumberOfDescriptors * sizeof(EFI_GCD_IO_SPACE_DESCRIPTOR), IoMap); + } *GcdIoMapNumberOfDescriptors = NumberOfDescriptors; } } - + if (DumpPrint) { DEBUG ((DEBUG_INFO, " TestPointDumpGcd - Exit\n")); } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47565): https://edk2.groups.io/g/devel/message/47565 Mute This Topic: https://groups.io/mt/34197426/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: Add check for pointers
OK I'll update that then. Thanks, Shenglei > -Original Message- > From: Chiu, Chasel > Sent: Thursday, September 19, 2019 5:27 PM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Kubacki, Michael A ; Desimone, Nathaniel L > ; Gao, Liming > Subject: RE: [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: > Add check for pointers > > > Please update commit message as the latest change does not return > EFI_NOT_FOUND in DxeCheckBootVariable.c. > With above updated, Reviewed-by: Chasel Chiu > > > > -Original Message- > > From: Zhang, Shenglei > > Sent: Thursday, September 19, 2019 4:08 PM > > To: devel@edk2.groups.io > > Cc: Kubacki, Michael A ; Chiu, Chasel > > ; Desimone, Nathaniel L > > ; Gao, Liming > > Subject: [edk2-platforms PATCH v5] MinPlatformPkg/TestPointCheckLib: Add > > check for pointers > > > > In DxeCheckBootVariable.c, add check for BootOrder and Variable that > > return EFI_NOT_FOUND when they are NULL. > > In DxeCheckGcd.c, add check for GcdIoMap to ensure it not NULL when > > allocating memory to what it points to. > > > > Cc: Michael Kubacki > > Cc: Chasel Chiu > > Cc: Nate DeSimone > > Cc: Liming Gao > > Signed-off-by: Shenglei Zhang > > --- > > > > v2: Update copyright > > > > v3: Fix the coding style. > > > > v4: Update the logic in DxeCheckBootVariable.c. > > We directly return when BootOrder/Variable == NULL, in previous versions. > > > > v5: Update the format of copyright and the coding style. > > > > .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 6 +++--- > > .../Test/Library/TestPointCheckLib/DxeCheckGcd.c | 8 +--- > > 2 files changed, 8 insertions(+), 6 deletions(-) > > > > diff --git > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckB > > ootVariable.c > > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckB > > ootVariable.c > > index 85bd5b3d..5437cf6a 100644 > > --- > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckB > > ootVariable.c > > +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh > > +++ eckBootVariable.c > > @@ -1,6 +1,6 @@ > > /** @file > > > > -Copyright (c) 2017, Intel Corporation. All rights reserved. > > +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -130,7 +130,7 @@ TestPointCheckLoadOptionVariable ( > >for (ListIndex = 0; ListIndex < > > sizeof(mLoadOptionVariableList)/sizeof(mLoadOptionVariableList[0]); > > ListIndex++) { > > UnicodeSPrint (BootOrderName, sizeof(BootOrderName), L"%sOrder", > > mLoadOptionVariableList[ListIndex]); > > Status = GetVariable2 (BootOrderName, &gEfiGlobalVariableGuid, > > (VOID **)&BootOrder, &OrderSize); > > -if (EFI_ERROR(Status)) { > > +if (EFI_ERROR(Status) || (BootOrder == NULL)) { > >continue; > > } > > for (Index = 0; Index < OrderSize/sizeof(CHAR16); Index++) { @@ > -222,7 > > +222,7 @@ TestPointCheckKeyOptionVariable ( > > for (Index = 0; ; Index++) { > >UnicodeSPrint (KeyOptionName, sizeof(KeyOptionName), > L"%s%04x", > > mKeyOptionVariableList[ListIndex], Index); > >Status = GetVariable2 (KeyOptionName, &gEfiGlobalVariableGuid, > > &Variable, &Size); > > - if (!EFI_ERROR(Status)) { > > + if (!EFI_ERROR(Status) && (Variable != NULL)) { > > DumpKeyOption (KeyOptionName, Variable, Size); > >} else { > > break; > > diff --git > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckG > > cd.c > > b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckG > > cd.c > > index 82709d44..066121c7 100644 > > --- > > a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckG > > cd.c > > +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCh > > +++ eckGcd.c > > @@ -1,6 +1,6 @@ > > /** @file > > > > -Copyright (c) 2017, Intel Corporation. All rights reserved. > > +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -241,11 +241,13 @@ TestPointDumpGcd ( > >} > > } > > if (GcdMemoryMap != NULL) { > > - *G
[edk2-devel] [PATCH v4] BaseTools/LzmaCompress: Add two switches
From: "Zhang, Shenglei" As is requested in the BZ 2077, add two switches to support setting compression mode and dictionary size. (https://bugzilla.tianocore.org/show_bug.cgi?id=2077) Cc: Bob Feng Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: 1.Update DictionarySize to mDictionarySize. 2.Update CompressionMode to mCompressionMode. 3.Use CLzmaEncProps *props as the input parameter of the function Encode. v3: Remove the component "mDictionarySize >= 0" in the if judgement.line 303 This is to fix the build failure under Mac OS. Beacuse the type of mDictionarySize is UINT64, which is always >= 0. v4: Update type of "props" when declaring and the consequent usage. The encoding functionality has been tested under Windows OS, Linux OS and Mac OS. .../Source/C/LzmaCompress/LzmaCompress.c | 41 +++ BaseTools/Source/C/LzmaCompress/GNUmakefile | 4 +- BaseTools/Source/C/LzmaCompress/Makefile | 4 +- 3 files changed, 38 insertions(+), 11 deletions(-) diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c index a3607f9b2084..856fcf9ffb17 100644 --- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c +++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c @@ -5,7 +5,7 @@ LzmaUtil.c -- Test application for LZMA compression 2018-04-30 : Igor Pavlov : Public domain - Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. + Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -23,6 +23,7 @@ #include "Sdk/C/LzmaEnc.h" #include "Sdk/C/Bra.h" #include "CommonLib.h" +#include "ParseInf.h" #define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8) @@ -36,10 +37,14 @@ const char *kCantReadMessage = "Can not read input file"; const char *kCantWriteMessage = "Can not write output file"; const char *kCantAllocateMessage = "Can not allocate memory"; const char *kDataErrorMessage = "Data error"; +const char *kInvalidParamValMessage = "Invalid parameter value"; static Bool mQuietMode = False; static CONVERTER_TYPE mConType = NoConverter; +UINT64 mDictionarySize = 31; +UINT64 mCompressionMode = 2; + #define UTILITY_NAME "LzmaCompress" #define UTILITY_MAJOR_VERSION 0 #define UTILITY_MINOR_VERSION 2 @@ -58,6 +63,8 @@ void PrintHelp(char *buffer) " -v, --verbose: increase output messages\n" " -q, --quiet: reduce output messages\n" " --debug [0-9]: set debug level\n" + " -a: set compression mode 0 = fast, 1 = normal, default: 1 (normal)\n" + " d: sets Dictionary size - [0, 30], default: 23 (8MB)\n" " --version: display the program version and exit\n" " -h, --help: display this help text\n" ); @@ -87,7 +94,7 @@ void PrintVersion(char *buffer) sprintf (buffer, "%s Version %d.%d %s ", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION); } -static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize) +static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 fileSize, CLzmaEncProps *props) { SRes res; size_t inSize = (size_t)fileSize; @@ -95,10 +102,6 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file Byte *outBuffer = 0; Byte *filteredStream = 0; size_t outSize; - CLzmaEncProps props; - - LzmaEncProps_Init(&props); - LzmaEncProps_Normalize(&props); if (inSize != 0) { inBuffer = (Byte *)MyAlloc(inSize); @@ -151,7 +154,7 @@ static SRes Encode(ISeqOutStream *outStream, ISeqInStream *inStream, UInt64 file res = LzmaEncode(outBuffer + LZMA_HEADER_SIZE, &outSizeProcessed, mConType != NoConverter ? filteredStream : inBuffer, inSize, -&props, outBuffer, &outPropsSize, 0, +props, outBuffer, &outPropsSize, 0, NULL, &g_Alloc, &g_Alloc); if (res != SZ_OK) @@ -246,6 +249,10 @@ int main2(int numArgs, const char *args[], char *rs) const char *outputFile = "file.tmp"; int param; UInt64 fileSize; + CLzmaEncProps props; + + LzmaEncProps_Init(&props); + LzmaEncProps_Normalize(&props); FileSeqInStream_CreateVTable(&inStream); File_Construct(&inStream.file); @@ -280,6 +287,24 @@ int main2(int numArgs, const char *args[], char *rs) // parameter compatibility with other build tools. // param++; +} else if (strcmp(args[param], "-a") == 0) { + AsciiStringToUint64(args[param + 1],FALSE,&mCompressionMode); + if ((mCompressionMode == 0)||(mCompressionMode == 1)){ +props.algo = (in
Re: [edk2-devel] [PATCH v2] DebugFeaturePkg: Remove white space and update the ending format
For this patch, I'll update the file format of AcpiDebug.c to Dos format when pushing the patch. Thanks, Shenglei > -Original Message- > From: Dong, Eric > Sent: Monday, September 9, 2019 8:36 AM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Gao, Liming > Subject: RE: [PATCH v2] DebugFeaturePkg: Remove white space and update > the ending format > > Reviewed-by: Eric Dong > > > -----Original Message- > > From: Zhang, Shenglei > > Sent: Saturday, September 7, 2019 1:16 AM > > To: devel@edk2.groups.io > > Cc: Dong, Eric ; Gao, Liming > > Subject: [PATCH v2] DebugFeaturePkg: Remove white space and update > the > > ending format > > > > Remove white space in AcpiDebug.c. > > The original end of last line in DebugFeaturePkg.dsc is '/r'. > > Now update it to '/r/n'. > > > > Cc: Eric Dong > > Cc: Liming Gao > > Signed-off-by: Shenglei Zhang > > --- > > v2: In v1 the patch remove the '/r'. In v2 it is updated to '/r/n'. > > The v1 patch is "DebugFeaturePkg: Remove white space and white > ending > > line". > > > > Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c | 3 +-- > > Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc | 2 +- > > 2 files changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c > > b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c > > index f9cd8bcb..5ad8d259 100644 > > --- a/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c > > +++ b/Platform/Intel/DebugFeaturePkg/AcpiDebug/AcpiDebug.c > > @@ -487,7 +487,7 @@ InitializeAcpiDebugSmm ( > >if (EFI_ERROR (Status)) { > > return Status; > >} > > - > > + > >Status = SmmBase2->InSmm (SmmBase2, &InSmm); > >ASSERT_EFI_ERROR (Status); > >if (EFI_ERROR (Status)) { > > @@ -519,4 +519,3 @@ InitializeAcpiDebugSmm ( > > > >return Status; > > } > > - > > diff --git a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc > > b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc > > index 30f57d5d..8e5ff4c9 100644 > > --- a/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc > > +++ b/Platform/Intel/DebugFeaturePkg/DebugFeaturePkg.dsc > > @@ -98,4 +98,4 @@ > >DebugFeaturePkg/AcpiDebug/AcpiDebugSmm.inf > > > > [BuildOptions] > > - *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES \ No > > newline at end of file > > + *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES > > -- > > 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47806): https://edk2.groups.io/g/devel/message/47806 Mute This Topic: https://groups.io/mt/33169036/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] BaseTools/LzmaCompress: Fix the option "d" dictionary size
The range of dictionary size is set from [0,30] to [0,27]. And update the help information for this. The previous logic for processing the parameter dict size is incorrect. Now fix the logic. The option "d" is added at 6b80310f34199d1f62e45e40fa902734735091fa. (https://bugzilla.tianocore.org/show_bug.cgi?id=2077) Cc: Bob Feng Cc: Liming Gao Signed-off-by: Shenglei Zhang --- BaseTools/Source/C/LzmaCompress/LzmaCompress.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c index 856fcf9ffb17..bebdb9aa84a1 100644 --- a/BaseTools/Source/C/LzmaCompress/LzmaCompress.c +++ b/BaseTools/Source/C/LzmaCompress/LzmaCompress.c @@ -42,7 +42,7 @@ const char *kInvalidParamValMessage = "Invalid parameter value"; static Bool mQuietMode = False; static CONVERTER_TYPE mConType = NoConverter; -UINT64 mDictionarySize = 31; +UINT64 mDictionarySize = 28; UINT64 mCompressionMode = 2; #define UTILITY_NAME "LzmaCompress" @@ -64,7 +64,7 @@ void PrintHelp(char *buffer) " -q, --quiet: reduce output messages\n" " --debug [0-9]: set debug level\n" " -a: set compression mode 0 = fast, 1 = normal, default: 1 (normal)\n" - " d: sets Dictionary size - [0, 30], default: 23 (8MB)\n" + " d: sets Dictionary size - [0, 27], default: 24 (16MB)\n" " --version: display the program version and exit\n" " -h, --help: display this help text\n" ); @@ -298,8 +298,12 @@ int main2(int numArgs, const char *args[], char *rs) } } else if (strcmp(args[param], "d") == 0) { AsciiStringToUint64(args[param + 1],FALSE,&mDictionarySize); - if (mDictionarySize <= 30){ -props.dictSize = (UINT32)mDictionarySize; + if (mDictionarySize <= 27) { +if (mDictionarySize == 0) { + props.dictSize = 0; +} else { + props.dictSize = (1 << mDictionarySize); +} param++; continue; } else { -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48275): https://edk2.groups.io/g/devel/message/48275 Mute This Topic: https://groups.io/mt/34341275/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] NetworkPkg/DxeNetLib: Change the order of conditions in IF statement
The condition, NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len, is meaningless if Index < 0. So 'Index < 0' should be performed first in the if statement. Cc: Siyuan Fu Cc: Jiaxin Wu Signed-off-by: Shenglei Zhang --- NetworkPkg/Library/DxeNetLib/NetBuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NetworkPkg/Library/DxeNetLib/NetBuffer.c b/NetworkPkg/Library/DxeNetLib/NetBuffer.c index 2408e9a10456..a35e67aa1f6c 100644 --- a/NetworkPkg/Library/DxeNetLib/NetBuffer.c +++ b/NetworkPkg/Library/DxeNetLib/NetBuffer.c @@ -1063,7 +1063,7 @@ NetbufAllocSpace ( } else { NetbufGetByte (Nbuf, 0, &Index); - if ((NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len) && (Index > 0)) { + if ((Index > 0) && (NET_HEADSPACE(&(Nbuf->BlockOp[Index])) < Len)) { Index--; } } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48863): https://edk2.groups.io/g/devel/message/48863 Mute This Topic: https://groups.io/mt/34508855/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL
If DpcEntry is NULL, it means it failed to be allocated space. ReturnStatus should be EFI_OUT_OF_RESOURCES regardless of the content of mDpcEntryFreeList. Cc: Siyuan Fu Cc: Jiaxin Wu Signed-off-by: Shenglei Zhang --- NetworkPkg/DpcDxe/Dpc.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/NetworkPkg/DpcDxe/Dpc.c b/NetworkPkg/DpcDxe/Dpc.c index 8a490949dc8c..ebdb978b254a 100644 --- a/NetworkPkg/DpcDxe/Dpc.c +++ b/NetworkPkg/DpcDxe/Dpc.c @@ -137,14 +137,11 @@ DpcQueueDpc ( gBS->RaiseTPL (TPL_HIGH_LEVEL); // - // If the allocation of a DPC entry fails, and the free list is empty, - // then return EFI_OUT_OF_RESOURCES. + // If the allocation of a DPC entry fails, return EFI_OUT_OF_RESOURCES. // if (DpcEntry == NULL) { -if (IsListEmpty (&mDpcEntryFreeList)) { - ReturnStatus = EFI_OUT_OF_RESOURCES; - goto Done; -} +ReturnStatus = EFI_OUT_OF_RESOURCES; +goto Done; } // -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48862): https://edk2.groups.io/g/devel/message/48862 Mute This Topic: https://groups.io/mt/34508854/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] ShellPkg/Shell/FileHandleWrappers.c: Add check for MemFile->Buffer
Add check for MemFile->Buffer. Return EFI_OUT_OF_RESOURCES if MemFile->Buffer is NULL. Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Shenglei Zhang --- ShellPkg/Application/Shell/FileHandleWrappers.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c index 587556c42495..673031c9c73a 100644 --- a/ShellPkg/Application/Shell/FileHandleWrappers.c +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c @@ -1644,7 +1644,10 @@ FileInterfaceMemWrite( // if ((UINTN)(MemFile->Position + (*BufferSize)) > (UINTN)(MemFile->BufferSize)) { MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), (UINTN)(MemFile->BufferSize) + (*BufferSize) + MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); - MemFile->BufferSize += (*BufferSize) + MEM_WRITE_REALLOC_OVERHEAD; + if (MemFile->Buffer == NULL){ +return EFI_OUT_OF_RESOURCES; + } + MemFile->BufferSize += (*BufferSize) + MEM_WRITE_REALLOC_OVERHEAD; } CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, Buffer, *BufferSize); MemFile->Position += (*BufferSize); @@ -1661,6 +1664,9 @@ FileInterfaceMemWrite( AsciiSPrint(AsciiBuffer, *BufferSize, "%S", Buffer); if ((UINTN)(MemFile->Position + AsciiStrSize(AsciiBuffer)) > (UINTN)(MemFile->BufferSize)) { MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) + MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); + if (MemFile->Buffer == NULL){ +return EFI_OUT_OF_RESOURCES; + } MemFile->BufferSize += AsciiStrSize(AsciiBuffer) + MEM_WRITE_REALLOC_OVERHEAD; } CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, AsciiBuffer, AsciiStrSize(AsciiBuffer)); -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48865): https://edk2.groups.io/g/devel/message/48865 Mute This Topic: https://groups.io/mt/34508892/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when DpcEntry is NULL
> -Original Message- > From: Fu, Siyuan > Sent: Saturday, October 12, 2019 3:59 PM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Wu, Jiaxin > Subject: RE: [PATCH] NetworkPkg/DpcDxe: Update the consequent logic > when DpcEntry is NULL > > > -Original Message- > > From: Zhang, Shenglei > > Sent: 2019年10月12日 15:43 > > To: devel@edk2.groups.io > > Cc: Fu, Siyuan ; Wu, Jiaxin > > Subject: [PATCH] NetworkPkg/DpcDxe: Update the consequent logic when > > DpcEntry is NULL > > > > If DpcEntry is NULL, it means it failed to be allocated space. > > ReturnStatus should be EFI_OUT_OF_RESOURCES regardless of the > > content of mDpcEntryFreeList. > > > > Cc: Siyuan Fu > > Cc: Jiaxin Wu > > Signed-off-by: Shenglei Zhang > > --- > > NetworkPkg/DpcDxe/Dpc.c | 9 +++-- > > 1 file changed, 3 insertions(+), 6 deletions(-) > > > > diff --git a/NetworkPkg/DpcDxe/Dpc.c b/NetworkPkg/DpcDxe/Dpc.c > > index 8a490949dc8c..ebdb978b254a 100644 > > --- a/NetworkPkg/DpcDxe/Dpc.c > > +++ b/NetworkPkg/DpcDxe/Dpc.c > > @@ -137,14 +137,11 @@ DpcQueueDpc ( > >gBS->RaiseTPL (TPL_HIGH_LEVEL); > > > >// > > - // If the allocation of a DPC entry fails, and the free list is > > empty, > > - // then return EFI_OUT_OF_RESOURCES. > > + // If the allocation of a DPC entry fails, return > > EFI_OUT_OF_RESOURCES. > >// > >if (DpcEntry == NULL) { > > -if (IsListEmpty (&mDpcEntryFreeList)) { > > - ReturnStatus = EFI_OUT_OF_RESOURCES; > > - goto Done; > > -} > > +ReturnStatus = EFI_OUT_OF_RESOURCES; > > +goto Done; > > I don't think it's a correct fix. This DpcEntry allocation is inside a for > loop which > tries to allocate 64 new DPC entries, if one of the allocation in the middle > of > this loop failed, the mDpcEntryFreeList will contain useable entries for this > DpcQueueDpc(), that's why original code doesn't treat it as an error. > > How do you find this issue? By code review or it cause some real problems? > It is my local tool that reported this issue. You are right so I will find another method to fix this. Thanks, Shenglei > Thanks > Siyuan > > >} > > > >// > > -- > > 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48869): https://edk2.groups.io/g/devel/message/48869 Mute This Topic: https://groups.io/mt/34508854/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] ShellPkg/Shell/FileHandleWrappers.c: Add check for MemFile->Buffer
Add check for MemFile->Buffer. Return EFI_OUT_OF_RESOURCES if MemFile->Buffer is NULL. Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Shenglei Zhang --- v2: Add the expressiong to free AsciiBuffer before the function is returned. ShellPkg/Application/Shell/FileHandleWrappers.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c b/ShellPkg/Application/Shell/FileHandleWrappers.c index 587556c42495..2d7bd7bec67e 100644 --- a/ShellPkg/Application/Shell/FileHandleWrappers.c +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c @@ -1644,6 +1644,9 @@ FileInterfaceMemWrite( // if ((UINTN)(MemFile->Position + (*BufferSize)) > (UINTN)(MemFile->BufferSize)) { MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), (UINTN)(MemFile->BufferSize) + (*BufferSize) + MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); + if (MemFile->Buffer == NULL){ +return EFI_OUT_OF_RESOURCES; + } MemFile->BufferSize += (*BufferSize) + MEM_WRITE_REALLOC_OVERHEAD; } CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, Buffer, *BufferSize); @@ -1661,6 +1664,10 @@ FileInterfaceMemWrite( AsciiSPrint(AsciiBuffer, *BufferSize, "%S", Buffer); if ((UINTN)(MemFile->Position + AsciiStrSize(AsciiBuffer)) > (UINTN)(MemFile->BufferSize)) { MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) + MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); + if (MemFile->Buffer == NULL){ +FreePool(AsciiBuffer); +return EFI_OUT_OF_RESOURCES; + } MemFile->BufferSize += AsciiStrSize(AsciiBuffer) + MEM_WRITE_REALLOC_OVERHEAD; } CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, AsciiBuffer, AsciiStrSize(AsciiBuffer)); -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48875): https://edk2.groups.io/g/devel/message/48875 Mute This Topic: https://groups.io/mt/34528724/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] NetworkPkg/IScsiDxe: Fix the index of array TargetUrlp[]
After the expression, 'CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len);', the '\0' should be set to TargetUrl[Field->Len] rather than TargetUrl[Field->Len + 1]. Besides the boundary check should be more strict. Field->Len should range from 0-254 rather than 0-255. Cc: Siyuan Fu Cc: Jiaxin Wu Signed-off-by: Shenglei Zhang --- NetworkPkg/IScsiDxe/IScsiDhcp.c | 7 --- NetworkPkg/IScsiDxe/IScsiDhcp6.c | 7 --- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c b/NetworkPkg/IScsiDxe/IScsiDhcp.c index d8c9fff6c65d..eac5b39991b7 100644 --- a/NetworkPkg/IScsiDxe/IScsiDhcp.c +++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c @@ -122,11 +122,12 @@ IScsiDhcpExtractRootPath ( // if ((!NET_IS_DIGIT (*(Field->Str))) && (*(Field->Str) != '[')) { ConfigNvData->DnsMode = TRUE; -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) { - return EFI_INVALID_PARAMETER; +if (Field->Len >= sizeof (ConfigNvData->TargetUrl) { + Status = EFI_INVALID_PARAMETER; + goto ON_EXIT; } CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len); -ConfigNvData->TargetUrl[Field->Len + 1] = '\0'; +ConfigNvData->TargetUrl[Field->Len] = '\0'; } else { ConfigNvData->DnsMode = FALSE; ZeroMem(ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl)); diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c b/NetworkPkg/IScsiDxe/IScsiDhcp6.c index 86a872adeccc..be66e6684a0e 100644 --- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c +++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c @@ -161,11 +161,12 @@ IScsiDhcp6ExtractRootPath ( // Server name is expressed as domain name, just save it. // if (ConfigNvData->DnsMode) { -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) { - return EFI_INVALID_PARAMETER; +if (Field->Len >= sizeof (ConfigNvData->TargetUrl)) { + Status = EFI_INVALID_PARAMETER; + goto ON_EXIT; } CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len); -ConfigNvData->TargetUrl[Field->Len + 1] = '\0'; +ConfigNvData->TargetUrl[Field->Len] = '\0'; } else { ZeroMem(&ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl)); Status = IScsiAsciiStrToIp (Field->Str, IpMode, &Ip); -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48876): https://edk2.groups.io/g/devel/message/48876 Mute This Topic: https://groups.io/mt/34529164/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] NetworkPkg/IScsiDxe: Fix the index of array TargetUrlp[]
After the expression, 'CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len);', the '\0' should be set to TargetUrl[Field->Len] rather than TargetUrl[Field->Len + 1]. Besides the boundary check should be more strict. Field->Len should range from 0-254 rather than 0-255. Cc: Siyuan Fu Cc: Jiaxin Wu Signed-off-by: Shenglei Zhang --- v2: Add missing ')' which causes build failure. NetworkPkg/IScsiDxe/IScsiDhcp.c | 7 --- NetworkPkg/IScsiDxe/IScsiDhcp6.c | 7 --- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c b/NetworkPkg/IScsiDxe/IScsiDhcp.c index d8c9fff6c65d..eac5b39991b7 100644 --- a/NetworkPkg/IScsiDxe/IScsiDhcp.c +++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c @@ -122,11 +122,12 @@ IScsiDhcpExtractRootPath ( // if ((!NET_IS_DIGIT (*(Field->Str))) && (*(Field->Str) != '[')) { ConfigNvData->DnsMode = TRUE; -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) { - return EFI_INVALID_PARAMETER; +if (Field->Len >= sizeof (ConfigNvData->TargetUrl)) { + Status = EFI_INVALID_PARAMETER; + goto ON_EXIT; } CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len); -ConfigNvData->TargetUrl[Field->Len + 1] = '\0'; +ConfigNvData->TargetUrl[Field->Len] = '\0'; } else { ConfigNvData->DnsMode = FALSE; ZeroMem(ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl)); diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c b/NetworkPkg/IScsiDxe/IScsiDhcp6.c index 86a872adeccc..be66e6684a0e 100644 --- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c +++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c @@ -161,11 +161,12 @@ IScsiDhcp6ExtractRootPath ( // Server name is expressed as domain name, just save it. // if (ConfigNvData->DnsMode) { -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) { - return EFI_INVALID_PARAMETER; +if (Field->Len >= sizeof (ConfigNvData->TargetUrl)) { + Status = EFI_INVALID_PARAMETER; + goto ON_EXIT; } CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len); -ConfigNvData->TargetUrl[Field->Len + 1] = '\0'; +ConfigNvData->TargetUrl[Field->Len] = '\0'; } else { ZeroMem(&ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl)); Status = IScsiAsciiStrToIp (Field->Str, IpMode, &Ip); -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48878): https://edk2.groups.io/g/devel/message/48878 Mute This Topic: https://groups.io/mt/34529690/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2] NetworkPkg/IScsiDxe: Fix the index of array TargetUrlp[]
Hi Philippe, > -Original Message- > From: Philippe Mathieu-Daudé [mailto:phi...@redhat.com] > Sent: Monday, October 14, 2019 5:35 PM > To: devel@edk2.groups.io; Zhang, Shenglei > Cc: Fu, Siyuan ; Wu, Jiaxin ; > Laszlo Ersek > Subject: Re: [edk2-devel] [PATCH v2] NetworkPkg/IScsiDxe: Fix the index of > array TargetUrlp[] > > Hi Zhang, > > On 10/14/19 5:14 AM, Zhang, Shenglei wrote: > > After the expression, > > 'CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len);', > > the '\0' should be set to TargetUrl[Field->Len] rather than > > TargetUrl[Field->Len + 1]. > > ^ This is one change, ... > > > Besides the boundary check should be more strict. > > Field->Len should range from 0-254 rather than 0-255. > > ^ ... and here we have another change. > > Can you split this in 2 patches? I think these two changes should be included in one patch. They are both about the variable ' Field->Len '. If one change pushed and the other one unchanged, The logic is then wrong. > > > Cc: Siyuan Fu > > Cc: Jiaxin Wu > > Signed-off-by: Shenglei Zhang > > --- > > > > v2: Add missing ')' which causes build failure. > > > > NetworkPkg/IScsiDxe/IScsiDhcp.c | 7 --- > > NetworkPkg/IScsiDxe/IScsiDhcp6.c | 7 --- > > 2 files changed, 8 insertions(+), 6 deletions(-) > > > > diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp.c > b/NetworkPkg/IScsiDxe/IScsiDhcp.c > > index d8c9fff6c65d..eac5b39991b7 100644 > > --- a/NetworkPkg/IScsiDxe/IScsiDhcp.c > > +++ b/NetworkPkg/IScsiDxe/IScsiDhcp.c > > @@ -122,11 +122,12 @@ IScsiDhcpExtractRootPath ( > > // > > if ((!NET_IS_DIGIT (*(Field->Str))) && (*(Field->Str) != '[')) { > > ConfigNvData->DnsMode = TRUE; > > -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) { > > - return EFI_INVALID_PARAMETER; > > +if (Field->Len >= sizeof (ConfigNvData->TargetUrl)) { > > + Status = EFI_INVALID_PARAMETER; > > + goto ON_EXIT; > > This is a change in the code flow. So now we free he allocated TmpStr. > This is correct, but you did not commented that change in the > description. So we currently have a memory leak. Please do not hide that > kind of information in patches. Yes the commit message should contain this change. > > > } > > CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len); > > -ConfigNvData->TargetUrl[Field->Len + 1] = '\0'; > > +ConfigNvData->TargetUrl[Field->Len] = '\0'; > > And here we have 1 byte of memory info leak. > > Are you fixing a Security BZ? No, I found this issue by my local tool. There is no BZ for this. Thanks, Shenglei > > > } else { > > ConfigNvData->DnsMode = FALSE; > > ZeroMem(ConfigNvData->TargetUrl, sizeof (ConfigNvData->TargetUrl)); > > diff --git a/NetworkPkg/IScsiDxe/IScsiDhcp6.c > b/NetworkPkg/IScsiDxe/IScsiDhcp6.c > > index 86a872adeccc..be66e6684a0e 100644 > > --- a/NetworkPkg/IScsiDxe/IScsiDhcp6.c > > +++ b/NetworkPkg/IScsiDxe/IScsiDhcp6.c > > @@ -161,11 +161,12 @@ IScsiDhcp6ExtractRootPath ( > > // Server name is expressed as domain name, just save it. > > // > > if (ConfigNvData->DnsMode) { > > -if (Field->Len > sizeof (ConfigNvData->TargetUrl)) { > > - return EFI_INVALID_PARAMETER; > > +if (Field->Len >= sizeof (ConfigNvData->TargetUrl)) { > > + Status = EFI_INVALID_PARAMETER; > > + goto ON_EXIT; > > } > > CopyMem (&ConfigNvData->TargetUrl, Field->Str, Field->Len); > > -ConfigNvData->TargetUrl[Field->Len + 1] = '\0'; > > +ConfigNvData->TargetUrl[Field->Len] = '\0'; > > } else { > > ZeroMem(&ConfigNvData->TargetUrl, sizeof (ConfigNvData- > >TargetUrl)); > > Status = IScsiAsciiStrToIp (Field->Str, IpMode, &Ip); > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48904): https://edk2.groups.io/g/devel/message/48904 Mute This Topic: https://groups.io/mt/34529690/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2] ShellPkg/Shell/FileHandleWrappers.c: Add check for MemFile->Buffer
> -Original Message- > From: Philippe Mathieu-Daudé [mailto:phi...@redhat.com] > Sent: Monday, October 14, 2019 5:39 PM > To: devel@edk2.groups.io; Gao, Zhichao ; Zhang, > Shenglei > Cc: Ni, Ray > Subject: Re: [edk2-devel] [PATCH v2] ShellPkg/Shell/FileHandleWrappers.c: > Add check for MemFile->Buffer > > On 10/14/19 8:35 AM, Gao, Zhichao wrote: > > Refer to CSS 5.2.2.6 Always put space before an open parenthesis. > > FreePool(AsciiBuffer); should be FreePool (AsciiBuffer); > > After address that, Reviewed-by: Zhichao Gao > > > > Thanks, > > Zhichao > > > >> -Original Message- > >> From: Zhang, Shenglei > >> Sent: Monday, October 14, 2019 9:25 AM > >> To: devel@edk2.groups.io > >> Cc: Ni, Ray ; Gao, Zhichao > >> Subject: [PATCH v2] ShellPkg/Shell/FileHandleWrappers.c: Add check for > >> MemFile->Buffer > >> > >> Add check for MemFile->Buffer. > >> Return EFI_OUT_OF_RESOURCES if MemFile->Buffer is NULL. > >> > >> Cc: Ray Ni > >> Cc: Zhichao Gao > >> Signed-off-by: Shenglei Zhang > >> --- > >> > >> v2: Add the expressiong to free AsciiBuffer before the function is > returned. > >> > >> ShellPkg/Application/Shell/FileHandleWrappers.c | 7 +++ > >> 1 file changed, 7 insertions(+) > >> > >> diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c > >> b/ShellPkg/Application/Shell/FileHandleWrappers.c > >> index 587556c42495..2d7bd7bec67e 100644 > >> --- a/ShellPkg/Application/Shell/FileHandleWrappers.c > >> +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c > >> @@ -1644,6 +1644,9 @@ FileInterfaceMemWrite( > >> // > >> if ((UINTN)(MemFile->Position + (*BufferSize)) > (UINTN)(MemFile- > >>> BufferSize)) { > >> MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), > >> (UINTN)(MemFile->BufferSize) + (*BufferSize) + > >> MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); > >> + if (MemFile->Buffer == NULL){ > > Also "Always put space before an open brace (curly bracket)" Sure. Thanks for pointing out this. I can do that before the patch is pushed. Thanks, Shenglei > > >> +return EFI_OUT_OF_RESOURCES; > >> + } > >> MemFile->BufferSize += (*BufferSize) + > >> MEM_WRITE_REALLOC_OVERHEAD; > >> } > >> CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, Buffer, > >> *BufferSize); @@ -1661,6 +1664,10 @@ FileInterfaceMemWrite( > >> AsciiSPrint(AsciiBuffer, *BufferSize, "%S", Buffer); > >> if ((UINTN)(MemFile->Position + AsciiStrSize(AsciiBuffer)) > > >> (UINTN)(MemFile->BufferSize)) { > >> MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize), > >> (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) + > >> MEM_WRITE_REALLOC_OVERHEAD, MemFile->Buffer); > >> + if (MemFile->Buffer == NULL){ > >> +FreePool(AsciiBuffer); > >> +return EFI_OUT_OF_RESOURCES; > >> + } > >> MemFile->BufferSize += AsciiStrSize(AsciiBuffer) + > >> MEM_WRITE_REALLOC_OVERHEAD; > >> } > >> CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, > AsciiBuffer, > >> AsciiStrSize(AsciiBuffer)); > >> -- > >> 2.18.0.windows.1 > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#48905): https://edk2.groups.io/g/devel/message/48905 Mute This Topic: https://groups.io/mt/34528724/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 0/2] Use submodule way to access brotli
Currently brotli is used and customized by edk2 in BaseTools and MdeModulePkg. These two patches make brotli a submodule in edk2. https://bugzilla.tianocore.org/show_bug.cgi?id=2558 https://bugzilla.tianocore.org/show_bug.cgi?id=2559 Cc: Liming Gao Cc: Jian J Wang Cc: Hao A Wu Cc: Bob Feng Shenglei Zhang (2): MdeModulePkg/BrotliCustomDecompressLib: Make brotli a submodule BaseTools: Make brotli a submodule .../C/BrotliCompress/common/dictionary.c | 5905 - .../C/BrotliCompress/common/transform.c | 235 - .../Source/C/BrotliCompress/dec/bit_reader.c | 48 - .../Source/C/BrotliCompress/dec/decode.c | 2497 --- .../Source/C/BrotliCompress/dec/huffman.c | 356 - BaseTools/Source/C/BrotliCompress/dec/state.c | 164 - .../BrotliCompress/enc/backward_references.c | 144 - .../enc/backward_references_hq.c | 830 --- .../Source/C/BrotliCompress/enc/bit_cost.c| 35 - .../C/BrotliCompress/enc/block_splitter.c | 194 - .../C/BrotliCompress/enc/brotli_bit_stream.c | 1331 .../Source/C/BrotliCompress/enc/cluster.c | 56 - .../C/BrotliCompress/enc/compress_fragment.c | 790 --- .../enc/compress_fragment_two_pass.c | 645 -- .../C/BrotliCompress/enc/dictionary_hash.c| 1120 .../Source/C/BrotliCompress/enc/encode.c | 1864 -- .../C/BrotliCompress/enc/encoder_dict.c | 32 - .../C/BrotliCompress/enc/entropy_encode.c | 501 -- .../Source/C/BrotliCompress/enc/histogram.c | 100 - .../C/BrotliCompress/enc/literal_cost.c | 175 - .../Source/C/BrotliCompress/enc/memory.c | 170 - .../Source/C/BrotliCompress/enc/metablock.c | 667 -- .../Source/C/BrotliCompress/enc/static_dict.c | 486 -- .../Source/C/BrotliCompress/enc/utf8_util.c | 85 - .../Source/C/BrotliCompress/tools/brotli.c| 1143 .../BrotliDecUefiSupport.c| 31 + .../common/dictionary.c | 5905 - .../common/transform.c| 235 - .../dec/bit_reader.c | 48 - .../BrotliCustomDecompressLib/dec/decode.c| 2500 --- .../BrotliCustomDecompressLib/dec/huffman.c | 356 - .../BrotliCustomDecompressLib/dec/state.c | 164 - .gitmodules |6 + BaseTools/Source/C/BrotliCompress/GNUmakefile | 54 +- BaseTools/Source/C/BrotliCompress/LICENSE | 19 - BaseTools/Source/C/BrotliCompress/Makefile| 52 +- BaseTools/Source/C/BrotliCompress/README.md | 26 - BaseTools/Source/C/BrotliCompress/ReadMe.txt |2 - BaseTools/Source/C/BrotliCompress/brotli |1 + .../C/BrotliCompress/common/constants.h | 64 - .../Source/C/BrotliCompress/common/context.h | 261 - .../C/BrotliCompress/common/dictionary.h | 64 - .../Source/C/BrotliCompress/common/platform.h | 558 -- .../C/BrotliCompress/common/transform.h | 80 - .../Source/C/BrotliCompress/common/version.h | 26 - .../Source/C/BrotliCompress/dec/bit_reader.h | 309 - .../Source/C/BrotliCompress/dec/huffman.h | 72 - .../Source/C/BrotliCompress/dec/prefix.h | 750 --- BaseTools/Source/C/BrotliCompress/dec/state.h | 258 - .../brotli-comparison-study-2015-09-22.pdf| Bin 215208 -> 0 bytes .../BrotliCompress/enc/backward_references.h | 38 - .../enc/backward_references_hq.h | 93 - .../enc/backward_references_inc.h | 153 - .../Source/C/BrotliCompress/enc/bit_cost.h| 63 - .../C/BrotliCompress/enc/bit_cost_inc.h | 127 - .../C/BrotliCompress/enc/block_encoder_inc.h | 34 - .../C/BrotliCompress/enc/block_splitter.h | 51 - .../C/BrotliCompress/enc/block_splitter_inc.h | 431 -- .../C/BrotliCompress/enc/brotli_bit_stream.h | 84 - .../Source/C/BrotliCompress/enc/cluster.h | 48 - .../Source/C/BrotliCompress/enc/cluster_inc.h | 317 - .../Source/C/BrotliCompress/enc/command.h | 190 - .../C/BrotliCompress/enc/compress_fragment.h | 61 - .../enc/compress_fragment_two_pass.h | 54 - .../C/BrotliCompress/enc/dictionary_hash.h| 24 - .../C/BrotliCompress/enc/encoder_dict.h | 41 - .../C/BrotliCompress/enc/entropy_encode.h | 122 - .../enc/entropy_encode_static.h | 539 -- .../Source/C/BrotliCompress/enc/fast_log.h| 147 - .../C/BrotliCompress/enc/find_match_length.h | 80 - BaseTools/Source/C/BrotliCompress/enc/hash.h | 497 -- .../C/BrotliCompress/enc/hash_composite_inc.h | 133 - .../enc/hash_forgetful_chain_inc.h| 254 - .../enc/hash_longest_match64_inc.h| 266 - .../enc/hash_longest_match_inc.h | 258 - .../enc/hash_longest_match_quickly_inc.h | 235 - .../C/BrotliCompress/enc/hash_rolling_inc.h | 215 - .../enc/hash_to_binary_tree_inc.h | 327 - .../Source/C/BrotliCompress/enc/histogram.h | 63 - .../C/BrotliCompress/enc/histogram_inc.h | 51 - .../C/Br
Re: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Suspicious check for pointer Suite
Reviewed-by: Shenglei Zhang > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Wednesday, February 19, 2020 10:35 AM > To: devel@edk2.groups.io > Cc: GuoMinJ > Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Suspicious check for > pointer Suite > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2530 > > The Suite pointer is used before check if it is valid, > correct it to check the validation before use. > > Signed-off-by: GuoMinJ > --- > UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > index fb247c59e7..b053e04959 100644 > --- a/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > +++ b/UnitTestFrameworkPkg/Library/UnitTestLib/RunTests.c > @@ -33,13 +33,13 @@ RunTestSuite ( >UNIT_TEST *Test; >UNIT_TEST_FRAMEWORK *ParentFramework; > > - TestEntry = NULL; > - ParentFramework = (UNIT_TEST_FRAMEWORK *)Suite->ParentFramework; > - >if (Suite == NULL) { > return EFI_INVALID_PARAMETER; >} > > + TestEntry = NULL; > + ParentFramework = (UNIT_TEST_FRAMEWORK *)Suite- > >ParentFramework; > + >DEBUG ((DEBUG_VERBOSE, > " > -\n")); >DEBUG ((DEBUG_VERBOSE, "RUNNING TEST SUITE: %a\n", Suite->Title)); >DEBUG ((DEBUG_VERBOSE, > " > -\n")); > -- > 2.17.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55368): https://edk2.groups.io/g/devel/message/55368 Mute This Topic: https://groups.io/mt/71387157/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Invalid index may be used.
Reviewed-by: Shenglei Zhang > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Thursday, February 20, 2020 9:42 AM > To: devel@edk2.groups.io > Cc: GuoMinJ > Subject: [edk2-devel] [PATCH] UnitTestFrameworkPkg: Invalid index may be > used. > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2535 > > The UINT_TEST_STATUS and FAILURE_TYPE have used 0 as status, so use 0 as > unknown is confused, remove it from array enumeration but keep it > location in the array. > > Signed-off-by: GuoMinJ > --- > .../Library/UnitTestResultReportLib/UnitTestResultReportLib.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git > a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > eportLib.c > b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > eportLib.c > index 687a04f55d..eba68e330c 100644 > --- > a/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > eportLib.c > +++ > b/UnitTestFrameworkPkg/Library/UnitTestResultReportLib/UnitTestResultR > eportLib.c > @@ -65,7 +65,7 @@ GetStringForUnitTestStatus ( > { >UINTN Index; > > - for (Index = 0; Index < ARRAY_SIZE (mStatusStrings); Index++) { > + for (Index = 0; Index < ARRAY_SIZE (mStatusStrings) - 1; Index++) { > if (mStatusStrings[Index].Status == Status) { >// >// Return string from matching entry > @@ -87,7 +87,7 @@ GetStringForFailureType ( > { >UINTN Index; > > - for (Index = 0; Index < ARRAY_SIZE (mFailureTypeStrings); Index++) { > + for (Index = 0; Index < ARRAY_SIZE (mFailureTypeStrings) - 1; Index++) { > if (mFailureTypeStrings[Index].Type == Failure) { >// >// Return string from matching entry > -- > 2.17.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55369): https://edk2.groups.io/g/devel/message/55369 Mute This Topic: https://groups.io/mt/71411719/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdeModulePkg/SdDxe: Potential NULL pointer on Token
> -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Saturday, February 22, 2020 1:25 PM > To: devel@edk2.groups.io > Cc: GuoMinJ > Subject: [edk2-devel] [PATCH] MdeModulePkg/SdDxe: Potential NULL > pointer on Token > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2286 > > Token pointer may be NULL, it is should be check before use it. > > Signed-off-by: GuoMinJ > --- > MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > index 9f42abe7e2..25ab5abb2d 100644 > --- a/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > +++ b/MdeModulePkg/Bus/Sd/SdDxe/SdBlockIo.c > @@ -1367,7 +1367,12 @@ SdEraseBlocks ( > return Status; >} > > - DEBUG ((EFI_D_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x Event %p > with %r\n", Lba, BlockNum, Token->Event, Status)); > + DEBUG ((DEBUG_ERROR, "SdEraseBlocks(): Lba 0x%x BlkNo 0x%x with %r, > ", Lba, BlockNum, Status)); > + if ((Token != NULL) && (Token->Event != NULL)) { > +DEBUG ((DEBUG_ERROR, "Event pointer is %p\n", Token->Event)); I think a close brace is need here. Thanks, Shenglei > + else { > +DEBUG ((DEBUG_ERROR, "Event is meaningless\n")); > + } > >return Status; > } > -- > 2.17.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55370): https://edk2.groups.io/g/devel/message/55370 Mute This Topic: https://groups.io/mt/71466355/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] CryptoPkg: ECC issue.
Hi Guomin, Please update the subject and let us know the brief change through it. The details could be placed in commit message. When sending a patch of next version, you can update the subject prefix like "[PATCH v2] CryptoPkg: *** ". Thanks, Shenglei > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Tuesday, February 25, 2020 9:53 AM > To: devel@edk2.groups.io > Cc: GuoMinJ > Subject: [edk2-devel] [PATCH] CryptoPkg: ECC issue. > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2552 > > Some issue is reported by ECC tool, correct it. > > Signed-off-by: GuoMinJ > --- > .../Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.c | 9 + > CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf | 2 +- > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.c > b/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.c > index 34d5f410b0..b503a5708b 100644 > --- a/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.c > +++ b/CryptoPkg/Library/BaseCryptLibOnProtocolPpi/DxeCryptLib.c > @@ -32,6 +32,15 @@ GetCryptoServices ( >return (VOID *)mCryptoProtocol; > } > > +/** > + Locate the valid Crypto Protocol. > + > + @param ImageHandle The firmware allocated handle for the EFI image. > + @param SystemTable A pointer to the EFI System Table. > + > + @retval EFI_SUCCESS The constructor executed correctly. > + @retval EFI_NOT_FOUND Found no valid Crypto Protocol. > +**/ > EFI_STATUS > EFIAPI > DxeCryptLibConstructor ( > diff --git a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf > b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf > index b4d8675ddd..046320353b 100644 > --- a/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf > +++ b/CryptoPkg/Library/BaseHashApiLib/BaseHashApiLib.inf > @@ -17,7 +17,7 @@ >FILE_GUID = B1E566DD-DE7C-4F04-BDA0-B1295D3BE927 >MODULE_TYPE= BASE >VERSION_STRING = 1.0 > - LIBRARY_CLASS = BaseHashApiLib > + LIBRARY_CLASS = HashApiLib > > # > # The following information is for reference only and not required by the > build tools. > -- > 2.17.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55371): https://edk2.groups.io/g/devel/message/55371 Mute This Topic: https://groups.io/mt/71525362/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] UefiCpuPkg: ECC issue.
Same comments with mail thread " CryptoPkg: ECC issue. " Thanks, Shenglei > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > GuoMinJ > Sent: Tuesday, February 25, 2020 9:33 AM > To: devel@edk2.groups.io > Cc: GuoMinJ > Subject: [edk2-devel] [PATCH] UefiCpuPkg: ECC issue. > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2553 > > The comment haven't indicate the output attribute. > > Signed-off-by: GuoMinJ > --- > UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 2 +- > UefiCpuPkg/Library/MpInitLib/MpLib.h| 2 +- > UefiCpuPkg/Library/MpInitLib/PeiMpLib.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c > b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c > index a987c32109..096d1c9b4b 100644 > --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c > @@ -821,7 +821,7 @@ MpInitLibEnableDisableAP ( >This funtion will try to invoke platform specific microcode shadow logic to >relocate microcode update patches into memory. > > - @param[in] CpuMpData The pointer to CPU MP Data structure. > + @param[in, out] CpuMpData The pointer to CPU MP Data structure. > >@retval EFI_SUCCESS Shadow microcode success. >@retval EFI_OUT_OF_RESOURCES No enough resource to complete the > operation. > diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h > b/UefiCpuPkg/Library/MpInitLib/MpLib.h > index 455cb3f09a..06556197c3 100644 > --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h > +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h > @@ -658,7 +658,7 @@ GetProcessorNumber ( >This funtion will try to invoke platform specific microcode shadow logic to >relocate microcode update patches into memory. > > - @param[in] CpuMpData The pointer to CPU MP Data structure. > + @param[in, out] CpuMpData The pointer to CPU MP Data structure. > >@retval EFI_SUCCESS Shadow microcode success. >@retval EFI_OUT_OF_RESOURCES No enough resource to complete the > operation. > diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c > b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c > index 17b60903c5..a548fed23f 100644 > --- a/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c > +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpLib.c > @@ -644,7 +644,7 @@ MpInitLibEnableDisableAP ( >This funtion will try to invoke platform specific microcode shadow logic to >relocate microcode update patches into memory. > > - @param[in] CpuMpData The pointer to CPU MP Data structure. > + @param[in, out] CpuMpData The pointer to CPU MP Data structure. > >@retval EFI_SUCCESS Shadow microcode success. >@retval EFI_OUT_OF_RESOURCES No enough resource to complete the > operation. > -- > 2.17.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55372): https://edk2.groups.io/g/devel/message/55372 Mute This Topic: https://groups.io/mt/71524979/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] CryptoPkg/SysCall: Cast variables from 4 to 8-byte size
tp, pch, digits and xdigits are both 4-byte-size, but not cast to 8-byte-size when operated with 8-byte-size variables. This is a issue reported by my local static tool. Cc: Jian J Wang Cc: Xiaoyu Lu Signed-off-by: Shenglei Zhang --- CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c b/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c index 32e1ab8690e6..ad392b18ca66 100644 --- a/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c @@ -132,7 +132,7 @@ inet_pton4( const char *pch; if ((pch = strchr(digits, ch)) != NULL) { - u_int new = *tp * 10 + (u_int)(pch - digits); u_int new = (u_int)(*tp) * 10 + (u_int)pch - (u_int)digits; if (new > 255) return (0); @@ -200,7 +200,7 @@ inet_pton6( pch = strchr((xdigits = xdigits_u), ch); if (pch != NULL) { val <<= 4; - val |= (pch - xdigits); val |= (u_int)pch - (u_int)xdigits; if (val > 0x) return (0); saw_xdigit = 1; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51775): https://edk2.groups.io/g/devel/message/51775 Mute This Topic: https://groups.io/mt/66944007/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] SecurityPkg/RngDxe: Add ASSERT for array Ek
Add ASSERT for Ek to ensure things out of EK would not be visited. Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Signed-off-by: Shenglei Zhang --- SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.c | 2 ++ SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.c b/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.c index 66edaf10c468..6c99ec83e822 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.c +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.c @@ -160,6 +160,7 @@ AesExpandKey ( // Initialize the encryption key scheduler // for (Index2 = Nk, Index3 = 0; Index2 < Nw; Index2 += Nk, Index3++) { +ASSERT(Index2 < sizeof(Ek)/sizeof(Ek[0])); Temp = Ek[Index2 - 1]; Ek[Index2] = Ek[Index2 - Nk] ^ (AES_FT2((Temp >> 16) & 0xFF) & 0xFF00) ^ (AES_FT3((Temp >> 8) & 0xFF) & 0x00FF) ^ @@ -181,6 +182,7 @@ AesExpandKey ( Ek [Index1 + Index2] = Ek[Index1 + Index2 - Nk] ^ Ek[Index1 + Index2 - 1]; } if (Index2 + 4 < Nw) { +ASSERT((Index2 +4) < sizeof(Ek)/sizeof(Ek[0])); Temp = Ek[Index2 + 3]; Ek[Index2 + 4] = Ek[Index2 + 4 - Nk] ^ (AES_FT2((Temp >> 24) & 0xFF) & 0xFF00) ^ (AES_FT3((Temp >> 16) & 0xFF) & 0x00FF) ^ diff --git a/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.h b/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.h index e07f90050ac3..40d6b13d2b81 100644 --- a/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.h +++ b/SecurityPkg/RandomNumberGenerator/RngDxe/AesCore.h @@ -9,6 +9,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #ifndef __AES_CORE_H__ #define __AES_CORE_H__ +#include + /** Encrypts one single block data (128 bits) with AES algorithm. -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51806): https://edk2.groups.io/g/devel/message/51806 Mute This Topic: https://groups.io/mt/67403436/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] SecurityPkg/Tpm2Help.c: Add boundary check for array
Add 'Index < HASH_COUNT' to ensure things out of boundary of digests[] can not be visited. Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Signed-off-by: Shenglei Zhang --- SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c index 36c240d1221c..a7d4e3ab5373 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c @@ -299,7 +299,7 @@ GetDigestListSize ( UINT32 TotalSize; TotalSize = sizeof(DigestList->count); - for (Index = 0; Index < DigestList->count; Index++) { + for (Index = 0; Index < DigestList->count, Index < HASH_COUNT; Index++) { DigestSize = GetHashSizeFromAlgo (DigestList->digests[Index].hashAlg); TotalSize += sizeof(DigestList->digests[Index].hashAlg) + DigestSize; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#51807): https://edk2.groups.io/g/devel/message/51807 Mute This Topic: https://groups.io/mt/67403438/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 083/105] .mailmap: Add an entry for Shenglei Zhang
Reviewed-by: Shenglei Zhang > -Original Message- > From: Philippe Mathieu-Daude [mailto:phi...@redhat.com] > Sent: Friday, December 6, 2019 7:26 PM > To: devel@edk2.groups.io > Cc: Philippe Mathieu-Daude ; Zhang, Shenglei > > Subject: [PATCH v2 083/105] .mailmap: Add an entry for Shenglei Zhang > > We use .mailmap to display contributors email addresses in an > uniform format. > > Add an entry for Shenglei Zhang to have his name and email address > displayed properly in the git history. > > Cc: Shenglei Zhang > Signed-off-by: Philippe Mathieu-Daude > --- > [Due to MTA restricting the recipient list to 100, I can not Cc all the > named developers in the cover. Therefore I'm adapting the explaination > from the cover in each patch] > > This patch won't get merged if Shenglei Zhang doesn't give his > approval, by replying to this patch with: > Reviewed-by: Shenglei Zhang > > If you think this patch is inappropriate, you don't need to justify, > reply with: > NAcked-by: Shenglei Zhang > or simply: > NACK > > If your Firstname Lastname order is incorrect, tell me and I will fix it. > > You can also ignore this mail, but I might resend it and keep bothering > you. > > Regards, > > Phil. > --- > .mailmap | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/.mailmap b/.mailmap > index 4ff5a893b4da..80e31a25c7d0 100644 > --- a/.mailmap > +++ b/.mailmap > @@ -160,3 +160,4 @@ Sachin Agrawal > Samer El-Haj-Mahmoud el...@hp.com> > Satya Yarlagadda > Sergey Isakov > +Shenglei Zhang > -- > 2.21.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52196): https://edk2.groups.io/g/devel/message/52196 Mute This Topic: https://groups.io/mt/67468429/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] CryptoPkg/SysCall: Cast variables from 4 to 8-byte size
Thanks, Lazslo. I will add it to the exception list on my local tool. Thanks, Shenglei > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Laszlo Ersek > Sent: Saturday, December 7, 2019 10:11 PM > To: devel@edk2.groups.io; Zhang, Shenglei > Cc: Wang, Jian J ; Lu, XiaoyuX > Subject: Re: [edk2-devel] [PATCH] CryptoPkg/SysCall: Cast variables from 4 > to 8-byte size > > On 12/05/19 09:46, Zhang, Shenglei wrote: > > tp, pch, digits and xdigits are both 4-byte-size, but not > > cast to 8-byte-size when operated with 8-byte-size variables. > > This is a issue reported by my local static tool. > > > > Cc: Jian J Wang > > Cc: Xiaoyu Lu > > Signed-off-by: Shenglei Zhang > > --- > > CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c > b/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c > > index 32e1ab8690e6..ad392b18ca66 100644 > > --- a/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c > > +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/inet_pton.c > > @@ -132,7 +132,7 @@ inet_pton4( > > const char *pch; > > > > if ((pch = strchr(digits, ch)) != NULL) { > > - u_int new = *tp * 10 + (u_int)(pch - digits); > > u_int new = (u_int)(*tp) * 10 + (u_int)pch - > (u_int)digits; > > > > if (new > 255) > > return (0); > > @@ -200,7 +200,7 @@ inet_pton6( > > pch = strchr((xdigits = xdigits_u), ch); > > if (pch != NULL) { > > val <<= 4; > > - val |= (pch - xdigits); > > val |= (u_int)pch - (u_int)xdigits; > > if (val > 0x) > > return (0); > > saw_xdigit = 1; > > > > (1) This email does not look like a real patch for edk2. > > It removes some lines, yes, but the expressions that (I think?) it > proposes, as new lines, are not marked with "+". Instead, those are > displayed as existent code ("context"). > > But the file does not contain lines such as > > u_int new = (u_int)(*tp) * 10 + (u_int)pch - (u_int)digits; > > and > > val |= (u_int)pch - (u_int)xdigits; > > I don't understand how this patch was generated. Maybe you added the > new > lines in a separate patch before, and removed the old lines in a new > patch, and posted only the last (= partial change) patch. > > > (2) We can spell out the current edk2 types in the definition (and > initialization) of "new" below > > u_int new = *tp * 10 + (u_int)(pch - digits); > > as follows: > > UINTN new = (UINT8)*tp * (INT32)10 + > (UINTN)((CONST CHAR8 *)pch - (CONST CHAR8 *)digits); > > I don't have the slightest idea why a static analyzer whines about this. > > - the subtraction of the pointers is valid ("pch" points into "digits"), > - the result of the subtraction is a ptrdiff_t, > - ptrdiff_t can be safely converted to UINTN. > > Furthermore, > > - In the multiplication, UINT8 is promoted to INT32, and the value is > non-negative, and does not exceed 255 > - the multiplication is performed in INT32, and could never overflow > (because 255 * 10 = 2550 is representable in INT32), > - UINTN is either UINT32 or UINT64; for the addition, the INT32 product > is converted to UINTN, > - the addition is performed in UINTN, > - the result is stored to a UINTN. > > I think the static analyzer warning is wrong. > > I'd rather we supressed any such warning in some other way, for example > in the configuration of your static analyzer. Unless we find a critical > bug or evidently undefined behavior in this code, I'd like to keep it > intact (matching its origin from edk2-libc). > > > (3) In the assignment expression statement > > val |= (pch - xdigits); > > the subtraction uses (CONST CHAR8 *) operands. It is a valid subtraction > ("pch" points into the array pointed-to by "xdigits"). The result is of > type "ptrdiff_t" (per C spec), and has non-negative value. > > "val" is UINTN. > > Therefore we can spell out the above compound assignment as the below > simple assignment: > > val = (UINTN)val | (ptrdiff_t)(pch - xdigits); > > whicn means, in practice: > > - on 32-bit: > > val = (unsigned)val | (long)(pc
Re: [edk2-devel] [PATCH] SecurityPkg/Tpm2Help.c: Add boundary check for array
> -Original Message- > From: Yao, Jiewen > Sent: Friday, December 6, 2019 10:04 AM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Wang, Jian J ; Zhang, Chao B > > Subject: RE: [PATCH] SecurityPkg/Tpm2Help.c: Add boundary check for array > > Hi > May I know where is the data from? Trusted region or non-trusted region? > > I am thinking if we need use ASSERT to avoid user mistake. > But want to check the API input assumption at first... Hi Jiewen, I don't think DigestList->count can be trusted. We can add Index < HASH_COUNT into the for(...) statement. Thanks, Shenglei > > > > > -Original Message- > > From: Zhang, Shenglei > > Sent: Friday, December 6, 2019 9:50 AM > > To: devel@edk2.groups.io > > Cc: Yao, Jiewen ; Wang, Jian J > ; > > Zhang, Chao B > > Subject: [PATCH] SecurityPkg/Tpm2Help.c: Add boundary check for array > > > > Add 'Index < HASH_COUNT' to ensure things out of boundary > > of digests[] can not be visited. > > > > Cc: Jiewen Yao > > Cc: Jian J Wang > > Cc: Chao Zhang > > Signed-off-by: Shenglei Zhang > > --- > > SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > > b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > > index 36c240d1221c..a7d4e3ab5373 100644 > > --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > > +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > > @@ -299,7 +299,7 @@ GetDigestListSize ( > >UINT32 TotalSize; > > > >TotalSize = sizeof(DigestList->count); > > - for (Index = 0; Index < DigestList->count; Index++) { > > + for (Index = 0; Index < DigestList->count, Index < HASH_COUNT; Index++) > { > > DigestSize = GetHashSizeFromAlgo (DigestList->digests[Index].hashAlg); > > TotalSize += sizeof(DigestList->digests[Index].hashAlg) + DigestSize; > >} > > -- > > 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52240): https://edk2.groups.io/g/devel/message/52240 Mute This Topic: https://groups.io/mt/67403438/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] SecurityPkg/Tpm2Help.c: Add boundary check for array
> -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Laszlo Ersek > Sent: Friday, December 6, 2019 5:27 PM > To: devel@edk2.groups.io; Zhang, Shenglei > Cc: Yao, Jiewen ; Wang, Jian J > ; Zhang, Chao B > Subject: Re: [edk2-devel] [PATCH] SecurityPkg/Tpm2Help.c: Add boundary > check for array > > On 12/06/19 02:49, Zhang, Shenglei wrote: > > Add 'Index < HASH_COUNT' to ensure things out of boundary > > of digests[] can not be visited. > > > > Cc: Jiewen Yao > > Cc: Jian J Wang > > Cc: Chao Zhang > > Signed-off-by: Shenglei Zhang > > --- > > SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > > index 36c240d1221c..a7d4e3ab5373 100644 > > --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > > +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c > > @@ -299,7 +299,7 @@ GetDigestListSize ( > >UINT32 TotalSize; > > > >TotalSize = sizeof(DigestList->count); > > - for (Index = 0; Index < DigestList->count; Index++) { > > + for (Index = 0; Index < DigestList->count, Index < HASH_COUNT; Index++) > { > > DigestSize = GetHashSizeFromAlgo (DigestList->digests[Index].hashAlg); > > TotalSize += sizeof(DigestList->digests[Index].hashAlg) + DigestSize; > >} > > > > Nacked-by: Laszlo Ersek > > The comma operator is either functionally wrong in this context, or > stylistically wrong. From the C standard: > > The left operand of a comma operator is evaluated as a void > expression; there is a sequence point after its evaluation. Then the > right operand is evaluated; the result has its type and value. [...] > > In case we *only* need to check (Index < HASH_COUNT), then the patch is > stylistically incorrect: the (Index < DigestList->count) condition > should simply be removed. > > In case we need to check *both* conditions, then the patch is > functionally wrong: we should either use the logical AND (&&) operator, > instead of the comma: > > Index < DigestList->count && Index < HASH_COUNT > Hi Laszlo, You are right. I'll change the statement to include both conditions. Thanks, Shenglei > or invoke the MIN() function-like macro: > > Index < MIN ((UINTN)DigestList->count, (UINTN)HASH_COUNT) > > Thanks > Laszlo > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52241): https://edk2.groups.io/g/devel/message/52241 Mute This Topic: https://groups.io/mt/67403438/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] SecurityPkg/Tpm2Help.c: Add boundary check for array
Add 'Index < HASH_COUNT' to ensure things out of digests[] can not be visited. Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Signed-off-by: Shenglei Zhang --- v2: Remove the comma operator and use &&. SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c index 36c240d1221c..d7bc94006003 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Help.c @@ -299,7 +299,7 @@ GetDigestListSize ( UINT32 TotalSize; TotalSize = sizeof(DigestList->count); - for (Index = 0; Index < DigestList->count; Index++) { + for (Index = 0; Index < DigestList->count && Index < HASH_COUNT; Index++) { DigestSize = GetHashSizeFromAlgo (DigestList->digests[Index].hashAlg); TotalSize += sizeof(DigestList->digests[Index].hashAlg) + DigestSize; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#52242): https://edk2.groups.io/g/devel/message/52242 Mute This Topic: https://groups.io/mt/68718554/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel][edk2-platforms][PATCH] IntelSiliconPkg/Feature/SmmAccess/*: Fix incorrect Docygen comment
Reviewed-by: Shenglei Zhang > -Original Message- > From: Chen, Marc W > Sent: Thursday, December 26, 2019 2:53 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chaganty, Rangasai V > ; Gao, Liming ; > Zhang, Shenglei ; Chen, Marc W > > Subject: [edk2-devel][edk2-platforms][PATCH] > IntelSiliconPkg/Feature/SmmAccess/*: Fix incorrect Docygen comment > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2436 > > Cc: Michael Kubacki > Cc: Sai Chaganty > Cc: Liming Gao > Cc: Shenglei Zhang > Signed-off-by: Marc Chen > --- > .../Library/PeiSmmAccessLib/PeiSmmAccessLib.c | 19 -- > - > .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c | 6 +++--- > .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h | 13 + > > .../IntelSiliconPkg/Include/Library/SmmAccessLib.h| 5 + > 4 files changed, 17 insertions(+), 26 deletions(-) > > diff --git > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > index da141cfa0e..61da7ea0bd 100644 > --- > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > +++ > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > @@ -46,9 +46,9 @@ typedef struct { >The use of "open" means that the memory is visible from all PEIM >and SMM agents. > > + @param[in] PeiServices - General purpose services available to every > PEIM. >@param[in] This - Pointer to the SMM Access Interface. >@param[in] DescriptorIndex - Region of SMRAM to Open. > - @param[in] PeiServices - General purpose services available to every > PEIM. > >@retval EFI_SUCCESS- The region was successfully opened. >@retval EFI_DEVICE_ERROR - The region could not be opened because > locked by > @@ -193,12 +193,12 @@ Lock ( >ranges that are possible for SMRAM access, based upon the >memory controller capabilities. > > - @param[in] PeiServices - General purpose services available to every > PEIM. > - @param[in] This - Pointer to the SMRAM Access Interface. > - @param[in] SmramMapSize - Pointer to the variable containing size of the > - buffer to contain the description information. > - @param[in] SmramMap - Buffer containing the data describing the > Smram > - region descriptors. > + @param[in] PeiServices- General purpose services available to every > PEIM. > + @param[in] This - Pointer to the SMRAM Access Interface. > + @param[in, out] SmramMapSize - Pointer to the variable containing size > of the > + buffer to contain the description > information. > + @param[in, out] SmramMap - Buffer containing the data describing the > Smram > + region descriptors. > >@retval EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient > buffer. >@retval EFI_SUCCESS - The user provided a sufficiently-sized > buffer. > @@ -234,10 +234,7 @@ GetCapabilities ( > /** >This function is to install an SMM Access PPI >- Introduction \n > -A module to install a PPI for controlling SMM mode memory access > basically for S3 resume usage. > - > - - @result > -Publish _EFI_PEI_MM_ACCESS_PPI. > +An API to install a PEI_MM_ACCESS_PPI PPI for controlling SMM mode > memory access basically for S3 resume usage. > > @retval EFI_SUCCESS - Ppi successfully started and installed. > @retval EFI_NOT_FOUND - Ppi can't be found. > diff --git > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > index 3d3c4ab206..9409345f6b 100644 > --- > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > +++ > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > @@ -18,7 +18,7 @@ static SMM_ACCESS_PRIVATE_DATA mSmmAccess; >@param[in] SystemTable - Pointer to the EFI System Table > >@retval EFI_SUCCESS - Protocol was installed successfully > - @exception EFI_UNSUPPORTED- Protocol was not installed > + @retval EFI_UNSUPPORTED - Protocol was not installed >@retval EFI_NOT_FOUND - Protocol can't be found. >@retval EFI_OUT_OF_RESOURCES - Protocol does not have enou
Re: [edk2-devel][edk2-platforms][PATCH] IntelSiliconPkg/Feature/SmmAccess/*: Fix incorrect Docygen comment
Hi Ray, Could you help review this patch? Thanks, Shenglei > -Original Message- > From: Chen, Marc W > Sent: Thursday, December 26, 2019 2:53 PM > To: devel@edk2.groups.io > Cc: Kubacki, Michael A ; Chaganty, Rangasai V > ; Gao, Liming ; > Zhang, Shenglei ; Chen, Marc W > > Subject: [edk2-devel][edk2-platforms][PATCH] > IntelSiliconPkg/Feature/SmmAccess/*: Fix incorrect Docygen comment > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2436 > > Cc: Michael Kubacki > Cc: Sai Chaganty > Cc: Liming Gao > Cc: Shenglei Zhang > Signed-off-by: Marc Chen > --- > .../Library/PeiSmmAccessLib/PeiSmmAccessLib.c | 19 -- > - > .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.c | 6 +++--- > .../Feature/SmmAccess/SmmAccessDxe/SmmAccessDriver.h | 13 + > > .../IntelSiliconPkg/Include/Library/SmmAccessLib.h| 5 + > 4 files changed, 17 insertions(+), 26 deletions(-) > > diff --git > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > index da141cfa0e..61da7ea0bd 100644 > --- > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > +++ > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLi > b/PeiSmmAccessLib.c > @@ -46,9 +46,9 @@ typedef struct { >The use of "open" means that the memory is visible from all PEIM >and SMM agents. > > + @param[in] PeiServices - General purpose services available to every > PEIM. >@param[in] This - Pointer to the SMM Access Interface. >@param[in] DescriptorIndex - Region of SMRAM to Open. > - @param[in] PeiServices - General purpose services available to every > PEIM. > >@retval EFI_SUCCESS- The region was successfully opened. >@retval EFI_DEVICE_ERROR - The region could not be opened because > locked by > @@ -193,12 +193,12 @@ Lock ( >ranges that are possible for SMRAM access, based upon the >memory controller capabilities. > > - @param[in] PeiServices - General purpose services available to every > PEIM. > - @param[in] This - Pointer to the SMRAM Access Interface. > - @param[in] SmramMapSize - Pointer to the variable containing size of the > - buffer to contain the description information. > - @param[in] SmramMap - Buffer containing the data describing the > Smram > - region descriptors. > + @param[in] PeiServices- General purpose services available to every > PEIM. > + @param[in] This - Pointer to the SMRAM Access Interface. > + @param[in, out] SmramMapSize - Pointer to the variable containing size > of the > + buffer to contain the description > information. > + @param[in, out] SmramMap - Buffer containing the data describing the > Smram > + region descriptors. > >@retval EFI_BUFFER_TOO_SMALL - The user did not provide a sufficient > buffer. >@retval EFI_SUCCESS - The user provided a sufficiently-sized > buffer. > @@ -234,10 +234,7 @@ GetCapabilities ( > /** >This function is to install an SMM Access PPI >- Introduction \n > -A module to install a PPI for controlling SMM mode memory access > basically for S3 resume usage. > - > - - @result > -Publish _EFI_PEI_MM_ACCESS_PPI. > +An API to install a PEI_MM_ACCESS_PPI PPI for controlling SMM mode > memory access basically for S3 resume usage. > > @retval EFI_SUCCESS - Ppi successfully started and installed. > @retval EFI_NOT_FOUND - Ppi can't be found. > diff --git > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > index 3d3c4ab206..9409345f6b 100644 > --- > a/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > +++ > b/Silicon/Intel/IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAc > cessDriver.c > @@ -18,7 +18,7 @@ static SMM_ACCESS_PRIVATE_DATA mSmmAccess; >@param[in] SystemTable - Pointer to the EFI System Table > >@retval EFI_SUCCESS - Protocol was installed successfully > - @exception EFI_UNSUPPORTED- Protocol was not installed > + @retval EFI_UNSUPPORTED - Protocol was not installed >@retval EFI_NOT_FOUND - Protocol can't be found. >@retval EFI_OUT_OF
[edk2-devel] [PATCH 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory
Initialize MapMemory to 0 in HeapGuard.c. Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Shenglei Zhang --- MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c index 9477b94044ba..b4cb48843fb7 100644 --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c @@ -225,6 +225,8 @@ FindGuardedMemoryMap ( UINTN BitsToUnitEnd; EFI_STATUS Status; + MapMemory = 0; + // // Adjust current map table depth according to the address to access // -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49043): https://edk2.groups.io/g/devel/message/49043 Mute This Topic: https://groups.io/mt/34556043/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
Map is used but not Initialized. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Shenglei Zhang --- MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c index 7c6a6a5f9716..995ccd2463d2 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c @@ -534,6 +534,8 @@ EhcCreateUrb ( PEI_URB *Urb; VOID *Map; + Map = NULL; + Urb = Ehc->Urb; Urb->Signature = EHC_URB_SIG; InitializeListHead (&Urb->UrbList); -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49041): https://edk2.groups.io/g/devel/message/49041 Mute This Topic: https://groups.io/mt/34556040/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 0/3] MdeModulePkg: Initialize variables
Initialize the variables before used. Cc: Hao A Wu Cc: Ray Ni Cc: Dandan Bi Cc: Liming Gao Shenglei Zhang (3): MdeModulePkg/EhciPei: Initialize the variable Map MdeModulePkg/UhciPei: Initialize the variable RequestMap MdeModulePkg/Mem: Initialize the variable MapMemory MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 2 ++ MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 2 ++ MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++ 3 files changed, 6 insertions(+) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49040): https://edk2.groups.io/g/devel/message/49040 Mute This Topic: https://groups.io/mt/34556039/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap
RequestMap is used but not Initialized. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Shenglei Zhang --- MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c index b897c3f82ce6..a05834da3c4a 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c @@ -274,6 +274,8 @@ UhcControlTransfer ( PktID = INPUT_PACKET_ID; + RequestMap = NULL; + if (Request == NULL || TransferResult == NULL) { return EFI_INVALID_PARAMETER; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49042): https://edk2.groups.io/g/devel/message/49042 Mute This Topic: https://groups.io/mt/34556041/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] MdeModulePkg/Variable/Pei: Update the condition in if statement
IndexTable->Length is used as index in array IndexTable->Index[]. So IndexTable->Length needs to be checked, which should be less than the array size. Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/Variable/Pei/Variable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Variable/Pei/Variable.c b/MdeModulePkg/Universal/Variable/Pei/Variable.c index 715802f33c29..f61465fc3045 100644 --- a/MdeModulePkg/Universal/Variable/Pei/Variable.c +++ b/MdeModulePkg/Universal/Variable/Pei/Variable.c @@ -896,7 +896,7 @@ FindVariableEx ( // if ((IndexTable != NULL) && !StopRecord) { Offset = (UINTN) Variable - (UINTN) LastVariable; -if ((Offset > 0x0) || (IndexTable->Length == sizeof (IndexTable->Index) / sizeof (IndexTable->Index[0]))) { +if ((Offset > 0x0) || (IndexTable->Length >= sizeof (IndexTable->Index) / sizeof (IndexTable->Index[0]))) { // // Stop to record if the distance of two neighbouring VAR_ADDED variable is larger than the allowable scope(UINT16), // or the record buffer is full. -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49143): https://edk2.groups.io/g/devel/message/49143 Mute This Topic: https://groups.io/mt/34668808/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 4/4] MdeModulePkg/SetupBrowserDxe: Add check for GetBufferForValue()
The returned value from GetBufferForValue might be NULL, so add a check for that before it is used. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 5 + 1 file changed, 5 insertions(+) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c index 7f4929c2fcd9..984c68c6bb7a 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -1281,7 +1281,12 @@ IfrToUint ( Result->Type = EFI_IFR_TYPE_UNDEFINED; return EFI_SUCCESS; } + +if (GetBufferForValue (&Value) == NULL) { + return EFI_NOT_FOUND; +} Result->Value.u64 = *(UINT64*) GetBufferForValue (&Value); + if (Value.Type == EFI_IFR_TYPE_BUFFER) { FreePool (Value.Buffer); } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49148): https://edk2.groups.io/g/devel/message/49148 Mute This Topic: https://groups.io/mt/34668867/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 2/4] MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr
If the target string doesn't appear in the searched string, StringPtr will be NULL. So add a check for that. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 4 1 file changed, 4 insertions(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 71ea25bc19bf..f786da8e370a 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -909,6 +909,10 @@ CompareAndMergeDefaultString ( // To find the with AltConfigHdr in AltCfgResp, ignore other which follow it. // StringPtr = StrStr (*AltCfgResp, AltConfigHdr); + if (StringPtr == NULL) { +Status = EFI_NOT_FOUND; +goto Exit; + } StringPtrNext = StrStr (StringPtr + 1, L"&GUID"); if (StringPtrNext != NULL) { TempCharA = *StringPtrNext; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49146): https://edk2.groups.io/g/devel/message/49146 Mute This Topic: https://groups.io/mt/34668864/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry
Entry and RetEntry might be NULL before used. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c | 2 +- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 8e305e4243a5..7b453fa98c2b 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -143,7 +143,7 @@ DebuggerDisplaySymbolAccrodingToAddress ( // Find the nearest symbol address // CandidateAddress = EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNearestAddress, &Object, &Entry); - if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1) { + if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1 || Entry == NULL) { EDBPrint (L"Symbole at Address not found!\n"); return EFI_DEBUG_CONTINUE; } else if (Address != CandidateAddress) { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 85cc275c114b..90a9b9fbd7ee 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -2062,7 +2062,7 @@ EdbPrintSource ( &RetObject, &RetEntry ); - if (SymbolAddress == 0) { + if (SymbolAddress == 0 || RetEntry == NULL) { return 0 ; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49145): https://edk2.groups.io/g/devel/message/49145 Mute This Topic: https://groups.io/mt/34668863/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 0/4] MdeModulePkg: Add check for variables and return value
The variables and return value might be NULL. So add check for them before they are used. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Eric Dong Cc: Hao A Wu Cc: Liming Gao Shenglei Zhang (4): MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr MdeModulePkg/EsrtDxe: Add check for EsrtRepository MdeModulePkg/SetupBrowserDxe: Add check for GetBufferForValue() .../Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c| 2 +- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 +- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++ MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 4 MdeModulePkg/Universal/SetupBrowserDxe/Expression.c| 5 + 5 files changed, 21 insertions(+), 2 deletions(-) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49144): https://edk2.groups.io/g/devel/message/49144 Mute This Topic: https://groups.io/mt/34668862/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository
EsrtRepository might be NULL. So return EFI_OUT_OF_RESOURCES when it is NULL. Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c index f48125382dbc..fff17b98fa3d 100644 --- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c +++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c @@ -239,6 +239,11 @@ DeleteEsrtEntry( goto EXIT; } + if (EsrtRepository == NULL) { +Status = EFI_OUT_OF_RESOURCES; +goto EXIT; + } + if ((RepositorySize % sizeof(EFI_SYSTEM_RESOURCE_ENTRY)) != 0) { DEBUG((EFI_D_ERROR, "Repository Corrupt. Need to rebuild Repository.\n")); // @@ -332,6 +337,11 @@ UpdateEsrtEntry( &RepositorySize ); + if (EsrtRepository == NULL) { +Status = EFI_OUT_OF_RESOURCES; +goto EXIT; + } + if (!EFI_ERROR(Status)) { // // if exist, update Esrt cache repository -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49147): https://edk2.groups.io/g/devel/message/49147 Mute This Topic: https://groups.io/mt/34668866/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] MdeModulePkg/HiiDatabaseDxe: Add check for 'Private->Attribute >> 4'
The size of mHiiEfiColors is 16. mHiiEfiColors[Private->Attribute >> 4] may be out of boundary. So add a check for that. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index ca63df168c94..282a7a114d17 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -999,7 +999,12 @@ GetSystemFont ( } Info->ForegroundColor= mHiiEfiColors[Private->Attribute & 0x0f]; - Info->BackgroundColor= mHiiEfiColors[Private->Attribute >> 4]; + if ((Private->Attribute >> 4) < 16){ +Info->BackgroundColor= mHiiEfiColors[Private->Attribute >> 4]; + } else { +return EFI_INVALID_PARAMETER; + } + Info->FontInfoMask = EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_SYS_STYLE; Info->FontInfo.FontStyle = 0; Info->FontInfo.FontSize = EFI_GLYPH_HEIGHT; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49153): https://edk2.groups.io/g/devel/message/49153 Mute This Topic: https://groups.io/mt/34685172/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] MdeModulePkg/SdBlockIoPei: Add check for DeviceIndex
DeviceIndex is used as index in Slot[]. The max size of Slot[] is SD_PEIM_MAX_SLOTS. So DeviceIndex should be checked before used. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Shenglei Zhang --- MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c index 8fa58d65b22c..25530dcb34ce 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c @@ -174,7 +174,7 @@ SdBlockIoPeimGetMediaInfo ( Private = GET_SD_PEIM_HC_PRIVATE_DATA_FROM_THIS (This); - if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices)) { + if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices) || (DeviceIndex > (SD_PEIM_MAX_SLOTS - 1))) { return EFI_INVALID_PARAMETER; } @@ -252,7 +252,7 @@ SdBlockIoPeimReadBlocks ( return EFI_SUCCESS; } - if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices)) { + if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices) || (DeviceIndex > (SD_PEIM_MAX_SLOTS - 1))) { return EFI_INVALID_PARAMETER; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49154): https://edk2.groups.io/g/devel/message/49154 Mute This Topic: https://groups.io/mt/34685173/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] MdeModulePkg/Oniguruma: Remove redundant IF statement
The if statement is not necessary, so keep it to edk2 style. And this change has been merged to onigruma. REF:https://github.com/kkos/oniguruma/pull/158 Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- .../Oniguruma/unicode_fold1_key.c | 18 +++--- .../Oniguruma/unicode_fold2_key.c | 17 ++--- .../Oniguruma/unicode_fold3_key.c | 18 +++--- .../Oniguruma/unicode_unfold_key.c | 17 ++--- 4 files changed, 26 insertions(+), 44 deletions(-) diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1_key.c index 7dbd6a5995be..0aa54ee172b2 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1_key.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold1_key.c @@ -2983,17 +2983,13 @@ onigenc_unicode_fold1_key(OnigCodePoint codes[]) 4026 }; - if (0 == 0) -{ - int key = hash(codes); - - if (key <= MAX_HASH_VALUE) -{ - int index = wordlist[key]; - - if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds1 + index, 1) == 0) -return index; -} +int key = hash(codes); +if (key <= MAX_HASH_VALUE) { + int index = wordlist[key]; + if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds1 + index, 1) == 0) { +return index; + } } + return -1; } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2_key.c index 3d93e2417a2c..44f8cb660071 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2_key.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold2_key.c @@ -211,17 +211,12 @@ onigenc_unicode_fold2_key(OnigCodePoint codes[]) 129 }; - if (0 == 0) -{ - int key = hash(codes); - - if (key <= MAX_HASH_VALUE) -{ - int index = wordlist[key]; - - if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + index, 2) == 0) -return index; -} +int key = hash(codes); +if (key <= MAX_HASH_VALUE) { + int index = wordlist[key]; + if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds2 + index, 2) == 0) +return index; } + return -1; } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3_key.c index bdd5667c6ae2..b36500b135e6 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3_key.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_fold3_key.c @@ -121,17 +121,13 @@ onigenc_unicode_fold3_key(OnigCodePoint codes[]) 0 }; - if (0 == 0) -{ - int key = hash(codes); - - if (key <= MAX_HASH_VALUE) -{ - int index = wordlist[key]; - - if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds3 + index, 3) == 0) -return index; -} +int key = hash(codes); +if (key <= MAX_HASH_VALUE) { + int index = wordlist[key]; + if (index >= 0 && onig_codes_cmp(codes, OnigUnicodeFolds3 + index, 3) == 0) { +return index; + } } + return -1; } diff --git a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_key.c b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_key.c index 10f7889ea372..1f03b21cfe54 100644 --- a/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_key.c +++ b/MdeModulePkg/Universal/RegularExpressionDxe/Oniguruma/unicode_unfold_key.c @@ -3288,17 +3288,12 @@ onigenc_unicode_unfold_key(OnigCodePoint code) {0x1e907, 4005, 1} }; - if (0 == 0) -{ - int key = hash(&code); - - if (key <= MAX_HASH_VALUE) -{ - OnigCodePoint gcode = wordlist[key].code; - - if (code == gcode && wordlist[key].index >= 0) -return &wordlist[key]; -} +int key = hash(&code); +if (key <= MAX_HASH_VALUE) { + OnigCodePoint gcode = wordlist[key].code; + if (code == gcode && wordlist[key].index >= 0) { +return &wordlist[key]; + } } return 0; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49268): https://edk2.groups.io/g/devel/message/49268 Mute This Topic: https://groups.io/mt/36262345/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] CryptoPkg: Upgrade OpenSSL to 1.1.1d
Update openssl from 1.1.1b to 1.1.1d. Something needs to be noticed is that, there is a bug existing in the released 1_1_1d version(894da2fb7ed5d314ee5c2fc9fd2d9b8b74111596), which causes build failure. So we switch the code base to a usable version, which is 2 commits later than the stable tag. Now we use the version c3656cc594daac8167721dde7220f0e59ae146fc. This log is to fix the build failure. https://bugzilla.tianocore.org/show_bug.cgi?id=2226 Cc: Jian J Wang Cc: Xiaoyu Lu Signed-off-by: Shenglei Zhang --- CryptoPkg/Library/OpensslLib/OpensslLib.inf | 57 --- .../Library/OpensslLib/OpensslLibCrypto.inf | 49 CryptoPkg/Library/OpensslLib/openssl | 2 +- 3 files changed, 1 insertion(+), 107 deletions(-) diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf index 7432321fd431..07c21ebeaa21 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -34,9 +34,7 @@ [Sources] $(OPENSSL_PATH)/crypto/aes/aes_misc.c $(OPENSSL_PATH)/crypto/aes/aes_ofb.c $(OPENSSL_PATH)/crypto/aes/aes_wrap.c - $(OPENSSL_PATH)/crypto/aes/aes_locl.h $(OPENSSL_PATH)/crypto/aria/aria.c - $(OPENSSL_PATH)/crypto/arm_arch.h $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c $(OPENSSL_PATH)/crypto/asn1/a_digest.c @@ -101,21 +99,12 @@ [Sources] $(OPENSSL_PATH)/crypto/asn1/x_sig.c $(OPENSSL_PATH)/crypto/asn1/x_spki.c $(OPENSSL_PATH)/crypto/asn1/x_val.c - $(OPENSSL_PATH)/crypto/asn1/standard_methods.h - $(OPENSSL_PATH)/crypto/asn1/charmap.h - $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h - $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h - $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h $(OPENSSL_PATH)/crypto/async/arch/async_null.c $(OPENSSL_PATH)/crypto/async/arch/async_posix.c $(OPENSSL_PATH)/crypto/async/arch/async_win.c $(OPENSSL_PATH)/crypto/async/async.c $(OPENSSL_PATH)/crypto/async/async_err.c $(OPENSSL_PATH)/crypto/async/async_wait.c - $(OPENSSL_PATH)/crypto/async/arch/async_win.h - $(OPENSSL_PATH)/crypto/async/async_locl.h - $(OPENSSL_PATH)/crypto/async/arch/async_posix.h - $(OPENSSL_PATH)/crypto/async/arch/async_null.h $(OPENSSL_PATH)/crypto/bio/b_addr.c $(OPENSSL_PATH)/crypto/bio/b_dump.c $(OPENSSL_PATH)/crypto/bio/b_sock.c @@ -138,7 +127,6 @@ [Sources] $(OPENSSL_PATH)/crypto/bio/bss_mem.c $(OPENSSL_PATH)/crypto/bio/bss_null.c $(OPENSSL_PATH)/crypto/bio/bss_sock.c - $(OPENSSL_PATH)/crypto/bio/bio_lcl.h $(OPENSSL_PATH)/crypto/bn/bn_add.c $(OPENSSL_PATH)/crypto/bn/bn_asm.c $(OPENSSL_PATH)/crypto/bn/bn_blind.c @@ -170,9 +158,6 @@ [Sources] $(OPENSSL_PATH)/crypto/bn/bn_srp.c $(OPENSSL_PATH)/crypto/bn/bn_word.c $(OPENSSL_PATH)/crypto/bn/bn_x931p.c - $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h - $(OPENSSL_PATH)/crypto/bn/bn_prime.h - $(OPENSSL_PATH)/crypto/bn/bn_lcl.h $(OPENSSL_PATH)/crypto/buffer/buf_err.c $(OPENSSL_PATH)/crypto/buffer/buffer.c $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c @@ -181,7 +166,6 @@ [Sources] $(OPENSSL_PATH)/crypto/comp/c_zlib.c $(OPENSSL_PATH)/crypto/comp/comp_err.c $(OPENSSL_PATH)/crypto/comp/comp_lib.c - $(OPENSSL_PATH)/crypto/comp/comp_lcl.h $(OPENSSL_PATH)/crypto/conf/conf_api.c $(OPENSSL_PATH)/crypto/conf/conf_def.c $(OPENSSL_PATH)/crypto/conf/conf_err.c @@ -190,8 +174,6 @@ [Sources] $(OPENSSL_PATH)/crypto/conf/conf_mod.c $(OPENSSL_PATH)/crypto/conf/conf_sap.c $(OPENSSL_PATH)/crypto/conf/conf_ssl.c - $(OPENSSL_PATH)/crypto/conf/conf_lcl.h - $(OPENSSL_PATH)/crypto/conf/conf_def.h $(OPENSSL_PATH)/crypto/cpt_err.c $(OPENSSL_PATH)/crypto/cryptlib.c $(OPENSSL_PATH)/crypto/ctype.c @@ -215,8 +197,6 @@ [Sources] $(OPENSSL_PATH)/crypto/des/set_key.c $(OPENSSL_PATH)/crypto/des/str2key.c $(OPENSSL_PATH)/crypto/des/xcbc_enc.c - $(OPENSSL_PATH)/crypto/des/spr.h - $(OPENSSL_PATH)/crypto/des/des_locl.h $(OPENSSL_PATH)/crypto/dh/dh_ameth.c $(OPENSSL_PATH)/crypto/dh/dh_asn1.c $(OPENSSL_PATH)/crypto/dh/dh_check.c @@ -231,7 +211,6 @@ [Sources] $(OPENSSL_PATH)/crypto/dh/dh_prn.c $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c - $(OPENSSL_PATH)/crypto/dh/dh_locl.h $(OPENSSL_PATH)/crypto/dso/dso_dl.c $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c $(OPENSSL_PATH)/crypto/dso/dso_err.c @@ -239,7 +218,6 @@ [Sources] $(OPENSSL_PATH)/crypto/dso/dso_openssl.c $(OPENSSL_PATH)/crypto/dso/dso_vms.c $(OPENSSL_PATH)/crypto/dso/dso_win32.c - $(OPENSSL_PATH)/crypto/dso/dso_locl.h $(OPENSSL_PATH)/crypto/ebcdic.c $(OPENSSL_PATH)/crypto/err/err.c $(OPENSSL_PATH)/crypto/err/err_prn.c @@ -304,13 +282,11 @@ [Sources] $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c - $(OPENSSL_PATH)/crypto/evp/evp_locl.h $(OPENSSL_PATH)/crypto/ex_data.c $(OPENSSL_PATH)/crypto/getenv.c $(OPENSSL_PATH)/cryp
Re: [edk2-devel] [PATCH] CryptoPkg: Upgrade OpenSSL to 1.1.1d
Hi Laszlo, > -Original Message- > From: Laszlo Ersek [mailto:ler...@redhat.com] > Sent: Tuesday, October 22, 2019 12:29 AM > To: devel@edk2.groups.io; Zhang, Shenglei > Cc: Wang, Jian J ; Lu, XiaoyuX > ; David Woodhouse > Subject: Re: [edk2-devel] [PATCH] CryptoPkg: Upgrade OpenSSL to 1.1.1d > > On 10/21/19 10:06, Zhang, Shenglei wrote: > > Update openssl from 1.1.1b to 1.1.1d. > > Something needs to be noticed is that, there is a bug existing in the > > released 1_1_1d version(894da2fb7ed5d314ee5c2fc9fd2d9b8b74111596), > > which causes build failure. So we switch the code base to a usable > > version, which is 2 commits later than the stable tag. > > Now we use the version c3656cc594daac8167721dde7220f0e59ae146fc. > > This log is to fix the build failure. > > https://bugzilla.tianocore.org/show_bug.cgi?id=2226 > > > > Cc: Jian J Wang > > Cc: Xiaoyu Lu > > Signed-off-by: Shenglei Zhang > > --- > > CryptoPkg/Library/OpensslLib/OpensslLib.inf | 57 --- > > .../Library/OpensslLib/OpensslLibCrypto.inf | 49 > > CryptoPkg/Library/OpensslLib/openssl | 2 +- > > 3 files changed, 1 insertion(+), 107 deletions(-) > > When I try to apply this patch manually, on top of current master > (91f98c908627), then "git am" fails. > > However, if I try to reproduce this patch myself (advancing the > submodule to c3656cc594da, and then running "process_files.pl"), then > the result ("git diff") matches the code changes in the patch -- not > counting CRLF vs. LF, anyway. > > (It seems like the "git am" failure is due to mixed line-endings within > the patch -- the submodule reference hunk uses LFs, not CRLFs. I can > live with that.) > > Having to use openssl at c3656cc594da is unfortunate, but I think it's > justified. > > Unfortunately, with this update, the following build command fails for > me (it may fail for other OVMF builds as well, this was simply my first > attempt): > > $ nice build \ > -a IA32 \ > -p OvmfPkg/OvmfPkgIa32.dsc \ > -t GCC48 \ > -b DEBUG \ > -D SMM_REQUIRE \ > -D SECURE_BOOT_ENABLE \ > -D NETWORK_IP6_ENABLE \ > -D NETWORK_TLS_ENABLE \ > -D NETWORK_HTTP_BOOT_ENABLE \ > -D E1000_ENABLE \ > -n 4 \ > --report-file=$HOME/tmp/build.ovmf.32.report \ > --log=$HOME/tmp/build.ovmf.32.log \ > --cmd-len=65536 \ > --genfds-multi-thread > > The directly failing command is: > > "gcc" \ > -o > Build/OvmfIa32/DEBUG_GCC48/IA32/MdeModulePkg/Universal/Variable/R > untimeDxe/VariableSmm/DEBUG/VariableSmm.dll \ > -nostdlib \ > -Wl,-n,-q,--gc-sections \ > -z common-page-size=0x20 \ > -Wl,--entry,_ModuleEntryPoint \ > -u _ModuleEntryPoint \ > -Wl,- > Map,Build/OvmfIa32/DEBUG_GCC48/IA32/MdeModulePkg/Universal/Varia > ble/RuntimeDxe/VariableSmm/DEBUG/VariableSmm.map,--whole-archive \ > -Wl,-m,elf_i386,--oformat=elf32-i386 \ > -z common-page-size=0x1000 \ > -Wl,--start- > group,@Build/OvmfIa32/DEBUG_GCC48/IA32/MdeModulePkg/Universal/Va > riable/RuntimeDxe/VariableSmm/OUTPUT/static_library_files.lst,--end- > group \ > -g \ > -fshort-wchar \ > -fno-builtin \ > -fno-strict-aliasing \ > -Wall \ > -Werror \ > -Wno-array-bounds \ > -ffunction-sections \ > -fdata-sections \ > -include AutoGen.h \ > -fno-common \ > -DSTRING_ARRAY_NAME=VariableSmmStrings \ > -m32 \ > -march=i586 \ > -malign-double \ > -fno-stack-protector \ > -D EFI32 \ > -fno-asynchronous-unwind-tables \ > -Wno-address \ > -Os \ > -mno-mmx \ > -mno-sse \ > -D DISABLE_NEW_DEPRECATED_INTERFACES \ > -Wl,--defsym=PECOFF_HEADER_SIZE=0x220 \ > -Wl,--script=BaseTools/Scripts/GccBase.lds > > And the error message: > > > > Build/OvmfIa32/DEBUG_GCC48/IA32/CryptoPkg/Library/OpensslLib/Openssl > Lib/OUTPUT/OpensslLib.lib(dso_lib.obj): In function `DSO_new_method': > > CryptoPkg/Library/OpensslLib/openssl/crypto/dso/dso_lib.c:25: undefined > reference to `DSO_METHOD_openssl' > > > Build/OvmfIa32/DEBUG_GCC48/IA32/CryptoPkg/Library/OpensslLib/Openssl > Lib/OUTPUT/OpensslLib.lib(dso_lib.obj): In function `DSO_pathbyaddr': > > CryptoPkg/Library/OpensslLib/openssl/crypto/dso/dso_lib.c:314: > undefined reference to `DSO_METHOD_openssl' > > This is strange, because the missing function is provided by > "crypto/dso/dso_openssl.c", whi
Re: [edk2-devel] [PATCH] CryptoPkg: Upgrade OpenSSL to 1.1.1d
Hi Laszlo, > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Laszlo Ersek > Sent: Tuesday, October 22, 2019 12:46 AM > To: devel@edk2.groups.io; Gao, Liming ; Zhang, > Shenglei > Cc: Wang, Jian J ; Lu, XiaoyuX > ; David Woodhouse > Subject: Re: [edk2-devel] [PATCH] CryptoPkg: Upgrade OpenSSL to 1.1.1d > > On 10/21/19 15:37, Liming Gao wrote: > > Shenglei: > > Those header files are added as the missing header file > @8906f076de35b222a7d62bcf6ed1a4a2498a5791. > > Please keep them in INF file. > > If we needed to add those files manually to the INF file, then: > > - either the perl script ("process_files.pl") is wrong -- it should > generate those file names too, > > - or we should have added the files *outside* of the following comments: > > # Autogenerated files list starts here > # Autogenerated files list ends here > I prefer the latter suggestion. There is a BZ for the perl script update(https://bugzilla.tianocore.org/show_bug.cgi?id=2085). Before the update, we can move the added files outside the auto-generated scope. Thanks, Shenglei > Laszlo > > >> -Original Message- > >> From: devel@edk2.groups.io On Behalf Of > Zhang, Shenglei > >> Sent: Monday, October 21, 2019 4:07 PM > >> To: devel@edk2.groups.io > >> Cc: Wang, Jian J ; Lu, XiaoyuX > > >> Subject: [edk2-devel] [PATCH] CryptoPkg: Upgrade OpenSSL to 1.1.1d > >> > >> Update openssl from 1.1.1b to 1.1.1d. > >> Something needs to be noticed is that, there is a bug existing in the > >> released 1_1_1d version(894da2fb7ed5d314ee5c2fc9fd2d9b8b74111596), > >> which causes build failure. So we switch the code base to a usable > >> version, which is 2 commits later than the stable tag. > >> Now we use the version c3656cc594daac8167721dde7220f0e59ae146fc. > >> This log is to fix the build failure. > >> https://bugzilla.tianocore.org/show_bug.cgi?id=2226 > >> > >> Cc: Jian J Wang > >> Cc: Xiaoyu Lu > >> Signed-off-by: Shenglei Zhang > >> --- > >> CryptoPkg/Library/OpensslLib/OpensslLib.inf | 57 --- > >> .../Library/OpensslLib/OpensslLibCrypto.inf | 49 > >> CryptoPkg/Library/OpensslLib/openssl | 2 +- > >> 3 files changed, 1 insertion(+), 107 deletions(-) > >> > >> diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf > b/CryptoPkg/Library/OpensslLib/OpensslLib.inf > >> index 7432321fd431..07c21ebeaa21 100644 > >> --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf > >> +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf > >> @@ -34,9 +34,7 @@ [Sources] > >>$(OPENSSL_PATH)/crypto/aes/aes_misc.c > >>$(OPENSSL_PATH)/crypto/aes/aes_ofb.c > >>$(OPENSSL_PATH)/crypto/aes/aes_wrap.c > >> - $(OPENSSL_PATH)/crypto/aes/aes_locl.h > >>$(OPENSSL_PATH)/crypto/aria/aria.c > >> - $(OPENSSL_PATH)/crypto/arm_arch.h > >>$(OPENSSL_PATH)/crypto/asn1/a_bitstr.c > >>$(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c > >>$(OPENSSL_PATH)/crypto/asn1/a_digest.c > >> @@ -101,21 +99,12 @@ [Sources] > >>$(OPENSSL_PATH)/crypto/asn1/x_sig.c > >>$(OPENSSL_PATH)/crypto/asn1/x_spki.c > >>$(OPENSSL_PATH)/crypto/asn1/x_val.c > >> - $(OPENSSL_PATH)/crypto/asn1/standard_methods.h > >> - $(OPENSSL_PATH)/crypto/asn1/charmap.h > >> - $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h > >> - $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h > >> - $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h > >>$(OPENSSL_PATH)/crypto/async/arch/async_null.c > >>$(OPENSSL_PATH)/crypto/async/arch/async_posix.c > >>$(OPENSSL_PATH)/crypto/async/arch/async_win.c > >>$(OPENSSL_PATH)/crypto/async/async.c > >>$(OPENSSL_PATH)/crypto/async/async_err.c > >>$(OPENSSL_PATH)/crypto/async/async_wait.c > >> - $(OPENSSL_PATH)/crypto/async/arch/async_win.h > >> - $(OPENSSL_PATH)/crypto/async/async_locl.h > >> - $(OPENSSL_PATH)/crypto/async/arch/async_posix.h > >> - $(OPENSSL_PATH)/crypto/async/arch/async_null.h > >>$(OPENSSL_PATH)/crypto/bio/b_addr.c > >>$(OPENSSL_PATH)/crypto/bio/b_dump.c > >>$(OPENSSL_PATH)/crypto/bio/b_sock.c > >> @@ -138,7 +127,6 @@ [Sources] > >>$(OPENSSL_PATH)/crypto/bio/bss_mem.c > >>$(OPENSSL_PATH)/crypto/bio/bss_null.c > >>$(OPENSSL_PATH)/crypto/bio/bss_sock.c > >> - $(OPENSSL_PATH)/crypto/bio/bio
[edk2-devel] [PATCH] CryptoPkg/OpensslLib: Update process_files.pl to generate .h files
There are missing headers added into INF files at 8906f076de35b222a.. They are now manually added but not auto-generated. So we update the perl script to enable this feature. Meanwhile, update the order of the .h files in INF files, which are auto-generated now. https://bugzilla.tianocore.org/show_bug.cgi?id=2085 Cc: Jian J Wang Cc: Xiaoyu Lu Signed-off-by: Shenglei Zhang --- CryptoPkg/Library/OpensslLib/OpensslLib.inf | 103 +- .../Library/OpensslLib/OpensslLibCrypto.inf | 96 CryptoPkg/Library/OpensslLib/process_files.pl | 28 + 3 files changed, 129 insertions(+), 98 deletions(-) diff --git a/CryptoPkg/Library/OpensslLib/OpensslLib.inf b/CryptoPkg/Library/OpensslLib/OpensslLib.inf index b40d82783b4b..b28dd9e4800c 100644 --- a/CryptoPkg/Library/OpensslLib/OpensslLib.inf +++ b/CryptoPkg/Library/OpensslLib/OpensslLib.inf @@ -34,9 +34,7 @@ [Sources] $(OPENSSL_PATH)/crypto/aes/aes_misc.c $(OPENSSL_PATH)/crypto/aes/aes_ofb.c $(OPENSSL_PATH)/crypto/aes/aes_wrap.c - $(OPENSSL_PATH)/crypto/aes/aes_locl.h $(OPENSSL_PATH)/crypto/aria/aria.c - $(OPENSSL_PATH)/crypto/arm_arch.h $(OPENSSL_PATH)/crypto/asn1/a_bitstr.c $(OPENSSL_PATH)/crypto/asn1/a_d2i_fp.c $(OPENSSL_PATH)/crypto/asn1/a_digest.c @@ -101,21 +99,12 @@ [Sources] $(OPENSSL_PATH)/crypto/asn1/x_sig.c $(OPENSSL_PATH)/crypto/asn1/x_spki.c $(OPENSSL_PATH)/crypto/asn1/x_val.c - $(OPENSSL_PATH)/crypto/asn1/standard_methods.h - $(OPENSSL_PATH)/crypto/asn1/charmap.h - $(OPENSSL_PATH)/crypto/asn1/tbl_standard.h - $(OPENSSL_PATH)/crypto/asn1/asn1_item_list.h - $(OPENSSL_PATH)/crypto/asn1/asn1_locl.h $(OPENSSL_PATH)/crypto/async/arch/async_null.c $(OPENSSL_PATH)/crypto/async/arch/async_posix.c $(OPENSSL_PATH)/crypto/async/arch/async_win.c $(OPENSSL_PATH)/crypto/async/async.c $(OPENSSL_PATH)/crypto/async/async_err.c $(OPENSSL_PATH)/crypto/async/async_wait.c - $(OPENSSL_PATH)/crypto/async/arch/async_win.h - $(OPENSSL_PATH)/crypto/async/async_locl.h - $(OPENSSL_PATH)/crypto/async/arch/async_posix.h - $(OPENSSL_PATH)/crypto/async/arch/async_null.h $(OPENSSL_PATH)/crypto/bio/b_addr.c $(OPENSSL_PATH)/crypto/bio/b_dump.c $(OPENSSL_PATH)/crypto/bio/b_sock.c @@ -138,7 +127,6 @@ [Sources] $(OPENSSL_PATH)/crypto/bio/bss_mem.c $(OPENSSL_PATH)/crypto/bio/bss_null.c $(OPENSSL_PATH)/crypto/bio/bss_sock.c - $(OPENSSL_PATH)/crypto/bio/bio_lcl.h $(OPENSSL_PATH)/crypto/bn/bn_add.c $(OPENSSL_PATH)/crypto/bn/bn_asm.c $(OPENSSL_PATH)/crypto/bn/bn_blind.c @@ -170,9 +158,6 @@ [Sources] $(OPENSSL_PATH)/crypto/bn/bn_srp.c $(OPENSSL_PATH)/crypto/bn/bn_word.c $(OPENSSL_PATH)/crypto/bn/bn_x931p.c - $(OPENSSL_PATH)/crypto/bn/rsaz_exp.h - $(OPENSSL_PATH)/crypto/bn/bn_prime.h - $(OPENSSL_PATH)/crypto/bn/bn_lcl.h $(OPENSSL_PATH)/crypto/buffer/buf_err.c $(OPENSSL_PATH)/crypto/buffer/buffer.c $(OPENSSL_PATH)/crypto/cmac/cm_ameth.c @@ -181,7 +166,6 @@ [Sources] $(OPENSSL_PATH)/crypto/comp/c_zlib.c $(OPENSSL_PATH)/crypto/comp/comp_err.c $(OPENSSL_PATH)/crypto/comp/comp_lib.c - $(OPENSSL_PATH)/crypto/comp/comp_lcl.h $(OPENSSL_PATH)/crypto/conf/conf_api.c $(OPENSSL_PATH)/crypto/conf/conf_def.c $(OPENSSL_PATH)/crypto/conf/conf_err.c @@ -190,8 +174,6 @@ [Sources] $(OPENSSL_PATH)/crypto/conf/conf_mod.c $(OPENSSL_PATH)/crypto/conf/conf_sap.c $(OPENSSL_PATH)/crypto/conf/conf_ssl.c - $(OPENSSL_PATH)/crypto/conf/conf_lcl.h - $(OPENSSL_PATH)/crypto/conf/conf_def.h $(OPENSSL_PATH)/crypto/cpt_err.c $(OPENSSL_PATH)/crypto/cryptlib.c $(OPENSSL_PATH)/crypto/ctype.c @@ -215,8 +197,6 @@ [Sources] $(OPENSSL_PATH)/crypto/des/set_key.c $(OPENSSL_PATH)/crypto/des/str2key.c $(OPENSSL_PATH)/crypto/des/xcbc_enc.c - $(OPENSSL_PATH)/crypto/des/spr.h - $(OPENSSL_PATH)/crypto/des/des_locl.h $(OPENSSL_PATH)/crypto/dh/dh_ameth.c $(OPENSSL_PATH)/crypto/dh/dh_asn1.c $(OPENSSL_PATH)/crypto/dh/dh_check.c @@ -231,7 +211,6 @@ [Sources] $(OPENSSL_PATH)/crypto/dh/dh_prn.c $(OPENSSL_PATH)/crypto/dh/dh_rfc5114.c $(OPENSSL_PATH)/crypto/dh/dh_rfc7919.c - $(OPENSSL_PATH)/crypto/dh/dh_locl.h $(OPENSSL_PATH)/crypto/dso/dso_dl.c $(OPENSSL_PATH)/crypto/dso/dso_dlfcn.c $(OPENSSL_PATH)/crypto/dso/dso_err.c @@ -239,7 +218,6 @@ [Sources] $(OPENSSL_PATH)/crypto/dso/dso_openssl.c $(OPENSSL_PATH)/crypto/dso/dso_vms.c $(OPENSSL_PATH)/crypto/dso/dso_win32.c - $(OPENSSL_PATH)/crypto/dso/dso_locl.h $(OPENSSL_PATH)/crypto/ebcdic.c $(OPENSSL_PATH)/crypto/err/err.c $(OPENSSL_PATH)/crypto/err/err_prn.c @@ -304,13 +282,11 @@ [Sources] $(OPENSSL_PATH)/crypto/evp/pmeth_fn.c $(OPENSSL_PATH)/crypto/evp/pmeth_gn.c $(OPENSSL_PATH)/crypto/evp/pmeth_lib.c - $(OPENSSL_PATH)/crypto/evp/evp_locl.h $(OPENSSL_PATH)/crypto/ex_data.c $(OPENSSL_PATH)/crypto/getenv.c $(OPENSSL_PATH)/crypto/hmac/hm_ameth.c $(OPENSSL_PATH)/crypto/hmac/hm_pmeth.c $(OPENSSL_PATH)/crypto/hmac/hmac.c - $(OPENSSL_PATH)/crypto/hmac/
[edk2-devel] [PATCH v3] CryptoPkg: Upgrade OpenSSL to 1.1.1d
Update openssl from 1.1.1b to 1.1.1d. Something needs to be noticed is that, there is a bug existing in the released 1_1_1d version(894da2fb7ed5d314ee5c2fc9fd2d9b8b74111596), which causes build failure. So we switch the code base to a usable version, which is 2 commits later than the stable tag. Now we use the version c3656cc594daac8167721dde7220f0e59ae146fc. This log is to fix the build failure. https://bugzilla.tianocore.org/show_bug.cgi?id=2226 Besides, the absense of "DSO_NONE" in dso_conf.h causes build failure in OvmfPkg. So update process_files.pl to generate information from "crypto/include/internal/dso_conf.h.in". This patch has been tested on Kaby Lake platform. Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: Revert the changes in OpensslLib.inf and OpensslLibCrypto.inf. The removed header files could be auto-generated by process_files.pl now. v3: Add display information for dso_conf.h. CryptoPkg/Library/Include/internal/dso_conf.h | 16 CryptoPkg/Library/OpensslLib/openssl | 2 +- CryptoPkg/Library/OpensslLib/process_files.pl | 15 ++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/CryptoPkg/Library/Include/internal/dso_conf.h b/CryptoPkg/Library/Include/internal/dso_conf.h index e69de29bb2d1..43c891588bc2 100644 --- a/CryptoPkg/Library/Include/internal/dso_conf.h +++ b/CryptoPkg/Library/Include/internal/dso_conf.h @@ -0,0 +1,16 @@ +/* WARNING: do not edit! */ +/* Generated from crypto/include/internal/dso_conf.h.in */ +/* + * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_DSO_CONF_H +# define HEADER_DSO_CONF_H +# define DSO_NONE +# define DSO_EXTENSION ".so" +#endif diff --git a/CryptoPkg/Library/OpensslLib/openssl b/CryptoPkg/Library/OpensslLib/openssl index 50eaac9f3337..c3656cc594da 16 --- a/CryptoPkg/Library/OpensslLib/openssl +++ b/CryptoPkg/Library/OpensslLib/openssl @@ -1 +1 @@ -Subproject commit 50eaac9f3337667259de725451f201e784599687 +Subproject commit c3656cc594daac8167721dde7220f0e59ae146fc diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl index e13c0acb4dda..80dc3548bfba 100755 --- a/CryptoPkg/Library/OpensslLib/process_files.pl +++ b/CryptoPkg/Library/OpensslLib/process_files.pl @@ -106,6 +106,14 @@ BEGIN { ) == 0 || die "Failed to generate opensslconf.h!\n"; +# Generate dso_conf.h per config data +system( +"perl -I. -Mconfigdata util/dofile.pl " . +"crypto/include/internal/dso_conf.h.in " . +"> include/internal/dso_conf.h" +) == 0 || +die "Failed to generate dso_conf.h!\n"; + chdir($basedir) || die "Cannot change to base directory \"" . $basedir . "\""; @@ -221,12 +229,17 @@ rename( $new_inf_file, $inf_file ) || print "Done!"; # -# Copy opensslconf.h generated from OpenSSL Configuration +# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration # print "\n--> Duplicating opensslconf.h into Include/openssl ... "; copy($OPENSSL_PATH . "/include/openssl/opensslconf.h", $OPENSSL_PATH . "/../../Include/openssl/") || die "Cannot copy opensslconf.h!"; +print "Done!"; +print "\n--> Duplicating dso_conf.h into Include/internal ... "; +copy($OPENSSL_PATH . "/include/internal/dso_conf.h", + $OPENSSL_PATH . "/../../Include/internal/") || + die "Cannot copy dso_conf.h!"; print "Done!\n"; print "\nProcessing Files Done!\n"; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49623): https://edk2.groups.io/g/devel/message/49623 Mute This Topic: https://groups.io/mt/39747034/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] MdeModulePkg/SdBlockIoPei: Add check for DeviceIndex
> -Original Message- > From: Wu, Hao A > Sent: Wednesday, October 30, 2019 3:15 PM > To: devel@edk2.groups.io; Zhang, Shenglei > Cc: Ni, Ray > Subject: RE: [edk2-devel] [PATCH] MdeModulePkg/SdBlockIoPei: Add check > for DeviceIndex > > > -Original Message- > > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > > Zhang, Shenglei > > Sent: Thursday, October 17, 2019 2:21 PM > > To: devel@edk2.groups.io > > Cc: Wu, Hao A; Ni, Ray > > Subject: [edk2-devel] [PATCH] MdeModulePkg/SdBlockIoPei: Add check > for > > DeviceIndex > > > > DeviceIndex is used as index in Slot[]. The max size of Slot[] > > is SD_PEIM_MAX_SLOTS. So DeviceIndex should be checked before used. > > > > Cc: Hao A Wu > > Cc: Ray Ni > > Signed-off-by: Shenglei Zhang > > --- > > MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c > > b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c > > index 8fa58d65b22c..25530dcb34ce 100644 > > --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c > > +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c > > @@ -174,7 +174,7 @@ SdBlockIoPeimGetMediaInfo ( > > > >Private = GET_SD_PEIM_HC_PRIVATE_DATA_FROM_THIS (This); > > > > - if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices)) { > > + if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices) || > > (DeviceIndex > (SD_PEIM_MAX_SLOTS - 1))) { > > > Hello, > > I do not think the change is proper, since 'DeviceIndex' is used to access the > array Private->Slot[SD_PEIM_MAX_SLOTS] like: > > Private->Slot[DeviceIndex - 1] > > I think the change should be: > > ... || (DeviceIndex > (SD_PEIM_MAX_SLOTS) > > instead of: > > ... || (DeviceIndex > (SD_PEIM_MAX_SLOTS - 1) > > > Could you help to double confirm on this? Thanks in advance. > Hao, You are right. The index used below the if statement is " DeviceIndex -1" not " DeviceIndex ". Thanks, Shenglei > Best Regards, > Hao Wu > > > > return EFI_INVALID_PARAMETER; > >} > > > > @@ -252,7 +252,7 @@ SdBlockIoPeimReadBlocks ( > > return EFI_SUCCESS; > >} > > > > - if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices)) { > > + if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices) || > > (DeviceIndex > (SD_PEIM_MAX_SLOTS - 1))) { > > return EFI_INVALID_PARAMETER; > >} > > > > -- > > 2.18.0.windows.1 > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49645): https://edk2.groups.io/g/devel/message/49645 Mute This Topic: https://groups.io/mt/34685173/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] MdeModulePkg/SdBlockIoPei: Add check for DeviceIndex
DeviceIndex is used as index in Slot[]. The max size of Slot[] is SD_PEIM_MAX_SLOTS. So DeviceIndex should be checked before used. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Shenglei Zhang --- v2. Update the check boundary from "SD_PEIM_MAX_SLOTS-1" to "SD_PEIM_MAX_SLOTS". Beacuse DeviceIndex is used as "DeviceIndex-1" in arrays. MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c index 8fa58d65b22c..ebd8270ce8e0 100644 --- a/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c +++ b/MdeModulePkg/Bus/Sd/SdBlockIoPei/SdBlockIoPei.c @@ -174,7 +174,7 @@ SdBlockIoPeimGetMediaInfo ( Private = GET_SD_PEIM_HC_PRIVATE_DATA_FROM_THIS (This); - if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices)) { + if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices) || (DeviceIndex > SD_PEIM_MAX_SLOTS)) { return EFI_INVALID_PARAMETER; } @@ -252,7 +252,7 @@ SdBlockIoPeimReadBlocks ( return EFI_SUCCESS; } - if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices)) { + if ((DeviceIndex == 0) || (DeviceIndex > Private->TotalBlkIoDevices) || (DeviceIndex > SD_PEIM_MAX_SLOTS)) { return EFI_INVALID_PARAMETER; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49657): https://edk2.groups.io/g/devel/message/49657 Mute This Topic: https://groups.io/mt/39770853/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2] MdeModulePkg/HiiDatabaseDxe: Add check for 'Private->Attribute >> 4'
The size of mHiiEfiColors is 16. mHiiEfiColors[Private->Attribute >> 4] may be out of boundary. So add a check for that. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang --- v2: Instead of returing value, we add ASSERT to ensure "Private->Attribute >> 4" is not out of boundary. MdeModulePkg/Universal/HiiDatabaseDxe/Font.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c index ca63df168c94..1eee5ec76bb0 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/Font.c @@ -999,6 +999,7 @@ GetSystemFont ( } Info->ForegroundColor= mHiiEfiColors[Private->Attribute & 0x0f]; + ASSERT ((Private->Attribute >> 4) < 16); Info->BackgroundColor= mHiiEfiColors[Private->Attribute >> 4]; Info->FontInfoMask = EFI_FONT_INFO_SYS_FONT | EFI_FONT_INFO_SYS_SIZE | EFI_FONT_INFO_SYS_STYLE; Info->FontInfo.FontStyle = 0; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49658): https://edk2.groups.io/g/devel/message/49658 Mute This Topic: https://groups.io/mt/39783598/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 2/3] MdeModulePkg/UhciPei: Initialize the variable RequestMap
RequestMap is used but not Initialized. RequestMap is called by UhciMapUserRequest, in which RequestMap(Map) is called by IoMmuMap, and is finally called by IoMmu->Map. We can not assume RequestMap is given an initial value at any step. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Shenglei Zhang --- MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c index b897c3f82ce6..a05834da3c4a 100644 --- a/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c +++ b/MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c @@ -274,6 +274,8 @@ UhcControlTransfer ( PktID = INPUT_PACKET_ID; + RequestMap = NULL; + if (Request == NULL || TransferResult == NULL) { return EFI_INVALID_PARAMETER; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49663): https://edk2.groups.io/g/devel/message/49663 Mute This Topic: https://groups.io/mt/39796153/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 0/3] MdeModulePkg: Initialize variables
Initialize the variables before used. v2: Commit message in all patches has been updated. Cc: Hao A Wu Cc: Ray Ni Cc: Dandan Bi Cc: Liming Gao Shenglei Zhang (3): MdeModulePkg/EhciPei: Initialize the variable Map MdeModulePkg/UhciPei: Initialize the variable RequestMap MdeModulePkg/Mem: Initialize the variable MapMemory MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 2 ++ MdeModulePkg/Bus/Pci/UhciPei/UhcPeim.c | 2 ++ MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++ 3 files changed, 6 insertions(+) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49661): https://edk2.groups.io/g/devel/message/49661 Mute This Topic: https://groups.io/mt/39796112/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory
MapMemory is not initialized by FindGuardedMemoryMap or CoreInternalAllocatePages which calls MapMemory. So we give a 0 to it. Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Shenglei Zhang --- MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c index 9477b94044ba..b4cb48843fb7 100644 --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c @@ -225,6 +225,8 @@ FindGuardedMemoryMap ( UINTN BitsToUnitEnd; EFI_STATUS Status; + MapMemory = 0; + // // Adjust current map table depth according to the address to access // -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49664): https://edk2.groups.io/g/devel/message/49664 Mute This Topic: https://groups.io/mt/39796173/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 1/3] MdeModulePkg/EhciPei: Initialize the variable Map
Map is used but not Initialized. Map is called by IoMmuMap, in which Mapping(Map) is called by IoMmu->Map. We can not assume Map is given an initial value at any step. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Shenglei Zhang --- MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c index 7c6a6a5f9716..995ccd2463d2 100644 --- a/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c +++ b/MdeModulePkg/Bus/Pci/EhciPei/EhciUrb.c @@ -534,6 +534,8 @@ EhcCreateUrb ( PEI_URB *Urb; VOID *Map; + Map = NULL; + Urb = Ehc->Urb; Urb->Signature = EHC_URB_SIG; InitializeListHead (&Urb->UrbList); -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49662): https://edk2.groups.io/g/devel/message/49662 Mute This Topic: https://groups.io/mt/39796126/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository
EsrtRepository might be NULL. So return EFI_OUT_OF_RESOURCES when it is NULL. Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c index f48125382dbc..fff17b98fa3d 100644 --- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c +++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c @@ -239,6 +239,11 @@ DeleteEsrtEntry( goto EXIT; } + if (EsrtRepository == NULL) { +Status = EFI_OUT_OF_RESOURCES; +goto EXIT; + } + if ((RepositorySize % sizeof(EFI_SYSTEM_RESOURCE_ENTRY)) != 0) { DEBUG((EFI_D_ERROR, "Repository Corrupt. Need to rebuild Repository.\n")); // @@ -332,6 +337,11 @@ UpdateEsrtEntry( &RepositorySize ); + if (EsrtRepository == NULL) { +Status = EFI_OUT_OF_RESOURCES; +goto EXIT; + } + if (!EFI_ERROR(Status)) { // // if exist, update Esrt cache repository -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49670): https://edk2.groups.io/g/devel/message/49670 Mute This Topic: https://groups.io/mt/39808346/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 0/4] MdeModulePkg: Add check for variables and return value
The variables and return value might be NULL. So add check for them before they are used. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Eric Dong Cc: Hao A Wu Cc: Liming Gao Shenglei Zhang (4): v2: Update the checking method in 02/04. MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr MdeModulePkg/EsrtDxe: Add check for EsrtRepository MdeModulePkg/SetupBrowserDxe: Add check for GetBufferForValue() .../Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c| 2 +- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 +- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++ MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 + MdeModulePkg/Universal/SetupBrowserDxe/Expression.c| 5 + 5 files changed, 18 insertions(+), 2 deletions(-) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49667): https://edk2.groups.io/g/devel/message/49667 Mute This Topic: https://groups.io/mt/39808291/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 4/4] MdeModulePkg/SetupBrowserDxe: Add check for GetBufferForValue()
The returned value from GetBufferForValue might be NULL, so add a check for that before it is used. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 5 + 1 file changed, 5 insertions(+) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c index 7f4929c2fcd9..984c68c6bb7a 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -1281,7 +1281,12 @@ IfrToUint ( Result->Type = EFI_IFR_TYPE_UNDEFINED; return EFI_SUCCESS; } + +if (GetBufferForValue (&Value) == NULL) { + return EFI_NOT_FOUND; +} Result->Value.u64 = *(UINT64*) GetBufferForValue (&Value); + if (Value.Type == EFI_IFR_TYPE_BUFFER) { FreePool (Value.Buffer); } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49671): https://edk2.groups.io/g/devel/message/49671 Mute This Topic: https://groups.io/mt/39808369/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry
Entry and RetEntry might be NULL before used. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c | 2 +- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 8e305e4243a5..7b453fa98c2b 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -143,7 +143,7 @@ DebuggerDisplaySymbolAccrodingToAddress ( // Find the nearest symbol address // CandidateAddress = EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNearestAddress, &Object, &Entry); - if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1) { + if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1 || Entry == NULL) { EDBPrint (L"Symbole at Address not found!\n"); return EFI_DEBUG_CONTINUE; } else if (Address != CandidateAddress) { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 85cc275c114b..90a9b9fbd7ee 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -2062,7 +2062,7 @@ EdbPrintSource ( &RetObject, &RetEntry ); - if (SymbolAddress == 0) { + if (SymbolAddress == 0 || RetEntry == NULL) { return 0 ; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49668): https://edk2.groups.io/g/devel/message/49668 Mute This Topic: https://groups.io/mt/39808301/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 2/4] MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr
If the target string doesn't appear in the searched string, StringPtr will be NULL. So add a check for that. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang --- v2: Instead of returning a value, we add ASSERT to ensure StringPtr is not NULL. MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 71ea25bc19bf..19a23fcc951e 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -909,6 +909,7 @@ CompareAndMergeDefaultString ( // To find the with AltConfigHdr in AltCfgResp, ignore other which follow it. // StringPtr = StrStr (*AltCfgResp, AltConfigHdr); + ASSERT (StringPtr != NULL); StringPtrNext = StrStr (StringPtr + 1, L"&GUID"); if (StringPtrNext != NULL) { TempCharA = *StringPtrNext; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49669): https://edk2.groups.io/g/devel/message/49669 Mute This Topic: https://groups.io/mt/39808322/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 2/4] MdeModulePkg/HiiDatabaseDxe: ASSERT StringPtr
The caller of CompareAndMergeDefaultString has checked that AltCfgResp must contain AltConfigHdr. So we add ASSERT to assume StringPtr is not NULL. Cc: Dandan Bi Cc: Eric Dong Signed-off-by: Shenglei Zhang Reviewed-by: Dandan Bi --- MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c index 71ea25bc19bf..2cad6d29f455 100644 --- a/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c +++ b/MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c @@ -909,6 +909,7 @@ CompareAndMergeDefaultString ( // To find the with AltConfigHdr in AltCfgResp, ignore other which follow it. // StringPtr = StrStr (*AltCfgResp, AltConfigHdr); + ASSERT (StringPtr != NULL); StringPtrNext = StrStr (StringPtr + 1, L"&GUID"); if (StringPtrNext != NULL) { TempCharA = *StringPtrNext; -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49796): https://edk2.groups.io/g/devel/message/49796 Mute This Topic: https://groups.io/mt/40403788/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
devel@edk2.groups.io
Before called by GetBufferForValue(), Value has already been called function IsTypeInBuffer to make sure the value must be buffer type. So GetBufferForValue can not return NULL. This commit adds ASSERT to assume (GetBufferForValue (&Value) is not NULL. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- v3: Add ASSERT instead of using error handling. MdeModulePkg/Universal/SetupBrowserDxe/Expression.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c index 7f4929c2fcd9..138912e00823 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Expression.c @@ -1281,7 +1281,10 @@ IfrToUint ( Result->Type = EFI_IFR_TYPE_UNDEFINED; return EFI_SUCCESS; } + +ASSERT ((GetBufferForValue (&Value) != NULL); Result->Value.u64 = *(UINT64*) GetBufferForValue (&Value); + if (Value.Type == EFI_IFR_TYPE_BUFFER) { FreePool (Value.Buffer); } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49798): https://edk2.groups.io/g/devel/message/49798 Mute This Topic: https://groups.io/mt/40403790/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 3/4] MdeModulePkg/EsrtDxe: Add check for EsrtRepository
EsrtRepository might be NULL. So return EFI_OUT_OF_RESOURCES when it is NULL. Cc: Hao A Wu Cc: Liming Gao Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c index f48125382dbc..fff17b98fa3d 100644 --- a/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c +++ b/MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c @@ -239,6 +239,11 @@ DeleteEsrtEntry( goto EXIT; } + if (EsrtRepository == NULL) { +Status = EFI_OUT_OF_RESOURCES; +goto EXIT; + } + if ((RepositorySize % sizeof(EFI_SYSTEM_RESOURCE_ENTRY)) != 0) { DEBUG((EFI_D_ERROR, "Repository Corrupt. Need to rebuild Repository.\n")); // @@ -332,6 +337,11 @@ UpdateEsrtEntry( &RepositorySize ); + if (EsrtRepository == NULL) { +Status = EFI_OUT_OF_RESOURCES; +goto EXIT; + } + if (!EFI_ERROR(Status)) { // // if exist, update Esrt cache repository -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49797): https://edk2.groups.io/g/devel/message/49797 Mute This Topic: https://groups.io/mt/40403789/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v3 1/4] MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry
Entry and RetEntry might be NULL before used. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang Reviewed-by: Hao A Wu --- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c | 2 +- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c index 8e305e4243a5..7b453fa98c2b 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c @@ -143,7 +143,7 @@ DebuggerDisplaySymbolAccrodingToAddress ( // Find the nearest symbol address // CandidateAddress = EbdFindSymbolAddress (Address, EdbMatchSymbolTypeNearestAddress, &Object, &Entry); - if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1) { + if (CandidateAddress == 0 || CandidateAddress == (UINTN) -1 || Entry == NULL) { EDBPrint (L"Symbole at Address not found!\n"); return EFI_DEBUG_CONTINUE; } else if (Address != CandidateAddress) { diff --git a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c index 85cc275c114b..90a9b9fbd7ee 100644 --- a/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c +++ b/MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c @@ -2062,7 +2062,7 @@ EdbPrintSource ( &RetObject, &RetEntry ); - if (SymbolAddress == 0) { + if (SymbolAddress == 0 || RetEntry == NULL) { return 0 ; } -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49795): https://edk2.groups.io/g/devel/message/49795 Mute This Topic: https://groups.io/mt/40403787/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v 3 0/4] MdeModulePkg: Add check and ASSERT for variables
Add error handling and ASSERT to ensure the variables are usable when called. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Eric Dong Cc: Hao A Wu Cc: Liming Gao Shenglei Zhang (4): v2: Update the checking method in 02/04. v3: Add ASSERT instead of error handling in 04/04. Shenglei Zhang (4): MdeModulePkg/EbcDebugger: Add check for Entry and RetEntry MdeModulePkg/HiiDatabaseDxe: Add check for StringPtr MdeModulePkg/EsrtDxe: Add check for EsrtRepository MdeModulePkg/SetupBrowserDxe: ASSERT GetBufferForValue(&Value) .../Universal/EbcDxe/EbcDebugger/EdbCmdSymbol.c| 2 +- MdeModulePkg/Universal/EbcDxe/EbcDebugger/EdbSymbol.c | 2 +- MdeModulePkg/Universal/EsrtDxe/EsrtImpl.c | 10 ++ MdeModulePkg/Universal/HiiDatabaseDxe/ConfigRouting.c | 1 + MdeModulePkg/Universal/SetupBrowserDxe/Expression.c| 3 +++ 5 files changed, 16 insertions(+), 2 deletions(-) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#49794): https://edk2.groups.io/g/devel/message/49794 Mute This Topic: https://groups.io/mt/40403786/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v4] CryptoPkg: Upgrade OpenSSL to 1.1.1d
Update openssl from 1.1.1b to 1.1.1d. Something needs to be noticed is that, there is a bug existing in the released 1_1_1d version(894da2fb7ed5d314ee5c2fc9fd2d9b8b74111596), which causes build failure. So we switch the code base to a usable version, which is 2 commits later than the stable tag. Now we use the version c3656cc594daac8167721dde7220f0e59ae146fc. This log is to fix the build failure. https://bugzilla.tianocore.org/show_bug.cgi?id=2226 Besides, the absense of "DSO_NONE" in dso_conf.h causes build failure in OvmfPkg. So update process_files.pl to generate information from "crypto/include/internal/dso_conf.h.in". shm.h and utsname.h are added to avoid GCC build failure. Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: Revert the changes in OpensslLib.inf and OpensslLibCrypto.inf. The removed header files could be auto-generated by process_files.pl now. v3: Add display information for dso_conf.h. v4: Add shm.h and utsname.h to avoid GCC build failure. CryptoPkg/Library/Include/internal/dso_conf.h | 16 CryptoPkg/Library/Include/sys/shm.h | 9 + CryptoPkg/Library/Include/sys/utsname.h | 10 ++ CryptoPkg/Library/OpensslLib/openssl | 2 +- CryptoPkg/Library/OpensslLib/process_files.pl | 15 ++- 5 files changed, 50 insertions(+), 2 deletions(-) create mode 100644 CryptoPkg/Library/Include/sys/shm.h create mode 100644 CryptoPkg/Library/Include/sys/utsname.h diff --git a/CryptoPkg/Library/Include/internal/dso_conf.h b/CryptoPkg/Library/Include/internal/dso_conf.h index e69de29bb2d1..43c891588bc2 100644 --- a/CryptoPkg/Library/Include/internal/dso_conf.h +++ b/CryptoPkg/Library/Include/internal/dso_conf.h @@ -0,0 +1,16 @@ +/* WARNING: do not edit! */ +/* Generated from crypto/include/internal/dso_conf.h.in */ +/* + * Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_DSO_CONF_H +# define HEADER_DSO_CONF_H +# define DSO_NONE +# define DSO_EXTENSION ".so" +#endif diff --git a/CryptoPkg/Library/Include/sys/shm.h b/CryptoPkg/Library/Include/sys/shm.h new file mode 100644 index ..dc0b8e81c8b0 --- /dev/null +++ b/CryptoPkg/Library/Include/sys/shm.h @@ -0,0 +1,9 @@ +/** @file + Include file to support building the third-party cryptographic library. + +Copyright (c) 2019, Intel Corporation. All rights reserved. +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include diff --git a/CryptoPkg/Library/Include/sys/utsname.h b/CryptoPkg/Library/Include/sys/utsname.h new file mode 100644 index ..75955b0a4eb6 --- /dev/null +++ b/CryptoPkg/Library/Include/sys/utsname.h @@ -0,0 +1,10 @@ +/** @file + Include file to support building the third-party cryptographic library. + +Copyright (c) 2019, Intel Corporation. All rights reserved. +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + diff --git a/CryptoPkg/Library/OpensslLib/openssl b/CryptoPkg/Library/OpensslLib/openssl index 50eaac9f3337..c3656cc594da 16 --- a/CryptoPkg/Library/OpensslLib/openssl +++ b/CryptoPkg/Library/OpensslLib/openssl @@ -1 +1 @@ -Subproject commit 50eaac9f3337667259de725451f201e784599687 +Subproject commit c3656cc594daac8167721dde7220f0e59ae146fc diff --git a/CryptoPkg/Library/OpensslLib/process_files.pl b/CryptoPkg/Library/OpensslLib/process_files.pl index 4fe54cd808a5..dd93bd84da22 100755 --- a/CryptoPkg/Library/OpensslLib/process_files.pl +++ b/CryptoPkg/Library/OpensslLib/process_files.pl @@ -106,6 +106,14 @@ BEGIN { ) == 0 || die "Failed to generate opensslconf.h!\n"; +# Generate dso_conf.h per config data +system( +"perl -I. -Mconfigdata util/dofile.pl " . +"crypto/include/internal/dso_conf.h.in " . +"> include/internal/dso_conf.h" +) == 0 || +die "Failed to generate dso_conf.h!\n"; + chdir($basedir) || die "Cannot change to base directory \"" . $basedir . "\""; @@ -249,12 +257,17 @@ rename( $new_inf_file, $inf_file ) || print "Done!"; # -# Copy opensslconf.h generated from OpenSSL Configuration +# Copy opensslconf.h and dso_conf.h generated from OpenSSL Configuration # print "\n--> Duplicating opensslconf.h into Include/openssl ... "; copy($OPENSSL_PATH . "/include/openssl/opensslconf.h", $OPENSSL_PATH . "/../../Include/openssl/") || die "Cannot copy opensslconf.h!"; +print "Done!"; +print "\n--> Duplicating dso_conf.h into Include/internal ... "; +copy($OPENSSL_PATH . "/include/internal/dso_conf.h", + $OPENSSL_PATH . "/../../Include/internal/") || + die "Cannot copy d
[edk2-devel] [PATCH] MdeModulePkg/SmiHandlerProfileInfo: Update the ranges of array index
Take the below code as example. if (Type >= 0 && Type <= ARRAY_SIZE(mSxTypeString)) { return mSxTypeString[Type]; The variable 'Type' used as index should range from 0 ~ ARRAY_SIZE-1. So the if statement should be : if (Type >= 0 && Type < ARRAY_SIZE(mSxTypeString)) { And other cases should also follow this rule. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2272 https://bugzilla.tianocore.org/show_bug.cgi?id=2287 https://bugzilla.tianocore.org/show_bug.cgi?id=2288 https://bugzilla.tianocore.org/show_bug.cgi?id=2289 https://bugzilla.tianocore.org/show_bug.cgi?id=2290 Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- .../SmiHandlerProfileInfo/SmiHandlerProfileInfo.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c index 0f7163160b4e..4f195b16ceb0 100644 --- a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c +++ b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c @@ -382,7 +382,7 @@ SxTypeToString ( IN EFI_SLEEP_TYPE Type ) { - if (Type >= 0 && Type <= ARRAY_SIZE(mSxTypeString)) { + if (Type >= 0 && Type < ARRAY_SIZE(mSxTypeString)) { return mSxTypeString[Type]; } else { AsciiSPrint (mNameString, sizeof(mNameString), "0x%x", Type); @@ -407,7 +407,7 @@ SxPhaseToString ( IN EFI_SLEEP_PHASE Phase ) { - if (Phase >= 0 && Phase <= ARRAY_SIZE(mSxPhaseString)) { + if (Phase >= 0 && Phase < ARRAY_SIZE(mSxPhaseString)) { return mSxPhaseString[Phase]; } else { AsciiSPrint (mNameString, sizeof(mNameString), "0x%x", Phase); @@ -457,7 +457,7 @@ StandbyButtonPhaseToString ( IN EFI_STANDBY_BUTTON_PHASE Phase ) { - if (Phase >= 0 && Phase <= ARRAY_SIZE(mStandbyButtonPhaseString)) { + if (Phase >= 0 && Phase < ARRAY_SIZE(mStandbyButtonPhaseString)) { return mStandbyButtonPhaseString[Phase]; } else { AsciiSPrint (mNameString, sizeof(mNameString), "0x%x", Phase); @@ -483,7 +483,7 @@ IoTrapTypeToString ( IN EFI_SMM_IO_TRAP_DISPATCH_TYPE Type ) { - if (Type >= 0 && Type <= ARRAY_SIZE(mIoTrapTypeString)) { + if (Type >= 0 && Type < ARRAY_SIZE(mIoTrapTypeString)) { return mIoTrapTypeString[Type]; } else { AsciiSPrint (mNameString, sizeof(mNameString), "0x%x", Type); @@ -508,7 +508,7 @@ UsbTypeToString ( IN EFI_USB_SMI_TYPE Type ) { - if (Type >= 0 && Type <= ARRAY_SIZE(mUsbTypeString)) { + if (Type >= 0 && Type < ARRAY_SIZE(mUsbTypeString)) { return mUsbTypeString[Type]; } else { AsciiSPrint (mNameString, sizeof(mNameString), "0x%x", Type); -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50283): https://edk2.groups.io/g/devel/message/50283 Mute This Topic: https://groups.io/mt/47268969/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 0/3] Add missing strings for uni files
From: Shenglei Zhang There are missing strings in MdeModulePkg.uni, NetworkPkg.uni and UefiCpuPkg.uni. So add them into uni files. Cc: Jian J Wang Cc: Hao A Wu Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Maciej Rabeda Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Shenglei Zhang (3): MdeModulePkg/MdeModulePkg.uni: Add missing strings for PCD NetworkPkg/NetworkPkg.uni: Add missing strings for PCD UefiCpuPkg/UefiCpuPkg.uni: Add missing strings for PCD MdeModulePkg/MdeModulePkg.uni | 12 NetworkPkg/NetworkPkg.uni | 7 +++ UefiCpuPkg/UefiCpuPkg.uni | 16 3 files changed, 35 insertions(+) -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50663): https://edk2.groups.io/g/devel/message/50663 Mute This Topic: https://groups.io/mt/57476153/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 1/3] MdeModulePkg/MdeModulePkg.uni: Add missing strings for PCD
From: Shenglei Zhang Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- MdeModulePkg/MdeModulePkg.uni | 12 1 file changed, 12 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni index a2c7a7ded3e8..d9c7b1ac6cf0 100644 --- a/MdeModulePkg/MdeModulePkg.uni +++ b/MdeModulePkg/MdeModulePkg.uni @@ -660,6 +660,18 @@ "TRUE - Device Path From Text Protocol will be produced.\n" "FALSE - Device Path From Text Protocol will not be produced." +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEnableVariableRuntimeCache_PROMPT #language en-US "Enable the UEFI variable runtime cache." + +#string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdEnableVariableRuntimeCache_HELP #language en-US "Indicates if the UEFI variable runtime cache should be enabled.\n" + "This setting only applies if SMM variables are enabled. When enabled, all variable\n" + "data for Runtime Service GetVariable () and GetNextVariableName () calls is retrieved\n" + "from a runtime data buffer referred to as the "runtime cache". An SMI is not triggered\n" + "at all for these requests. Variables writes still trigger an SMI. This can greatly\n" + "reduce overall system SMM usage as most boots tend to issue far more variable reads\n" + "than writes.\n" + "TRUE - The UEFI variable runtime cache is enabled.\n" + "FALSE - The UEFI variable runtime cache is disabled." + #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdVariableCollectStatistics_PROMPT #language en-US "Enable variable statistics collection" #string STR_gEfiMdeModulePkgTokenSpaceGuid_PcdVariableCollectStatistics_HELP #language en-US "Indicates if the statistics about variable usage will be collected. This information is stored as a vendor configuration table into the EFI system table. Set this PCD to TRUE to use VariableInfo application in MdeModulePkg\Application directory to get variable usage info. VariableInfo application will not output information if not set to TRUE.\n" -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50660): https://edk2.groups.io/g/devel/message/50660 Mute This Topic: https://groups.io/mt/57476141/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] UefiCpuPkg: Update the coding styles
From: Shenglei Zhang In MpLib.c, remove the white space on a new line. In PageTbl.c and PiSmmCpuDxeSmm.h, update the comment style. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Shenglei Zhang --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 +- UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c | 2 +- UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c| 2 +- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 49be5d5385d9..d32adf0780b7 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -475,7 +475,7 @@ CollectProcessorCount ( CpuPause (); } - + // // Enable x2APIC mode if // 1. Number of CPU is greater than 255; or diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c index f891a811126f..2483f2ea849d 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/PageTbl.c @@ -342,7 +342,7 @@ RestoreCr2 ( @retval TRUE Access to non-SMRAM is restricted. @retval FALSE Access to non-SMRAM is not restricted. -*/ +**/ BOOLEAN IsRestrictedMemoryAccess ( VOID diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c index e5c4788c13d7..810985df20ae 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c @@ -1275,7 +1275,7 @@ RestoreCr2 ( @retval TRUE Access to non-SMRAM is restricted. @retval FALSE Access to non-SMRAM is not restricted. -*/ +**/ BOOLEAN IsRestrictedMemoryAccess ( VOID diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h index daf977f654b4..7e7c73f27f76 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.h @@ -1455,7 +1455,7 @@ InitializeDataForMmMp ( @retval TRUE Access to non-SMRAM is restricted. @retval FALSE Access to non-SMRAM is not restricted. -*/ +**/ BOOLEAN IsRestrictedMemoryAccess ( VOID -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50661): https://edk2.groups.io/g/devel/message/50661 Mute This Topic: https://groups.io/mt/57476145/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH] MdePkg: Update the comments of IsLanguageSupported
From: Shenglei Zhang Keep the comment style of IsLanguageSupported align with other functions. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Shenglei Zhang --- MdePkg/Library/UefiLib/UefiLib.c | 18 +- MdePkg/Include/Library/UefiLib.h | 19 ++- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/MdePkg/Library/UefiLib/UefiLib.c b/MdePkg/Library/UefiLib/UefiLib.c index cc03be84c2d8..07c45d1e91ff 100644 --- a/MdePkg/Library/UefiLib/UefiLib.c +++ b/MdePkg/Library/UefiLib/UefiLib.c @@ -641,15 +641,15 @@ EfiTestChildHandle ( } /** - * This function checks the supported languages list for a target language, - * This only supports RFC 4646 Languages. - * - * @param SupportedLanguages The supported languages - * @param TargetLanguage The target language - * - * @return Returns EFI_SUCCESS if the language is supported, - * EFI_UNSUPPORTED otherwise - */ + This function checks the supported languages list for a target language, + This only supports RFC 4646 Languages. + + @param SupportedLanguages The supported languages + @param TargetLanguage The target language + + @retval Returns EFI_SUCCESS if the language is supported, + EFI_UNSUPPORTED otherwise +**/ EFI_STATUS EFIAPI IsLanguageSupported ( diff --git a/MdePkg/Include/Library/UefiLib.h b/MdePkg/Include/Library/UefiLib.h index 67c6f96747ca..0abb40d6ecbd 100644 --- a/MdePkg/Include/Library/UefiLib.h +++ b/MdePkg/Include/Library/UefiLib.h @@ -462,15 +462,16 @@ EfiTestChildHandle ( ); /** - * This function checks the supported languages list for a target language, - * This only supports RFC 4646 Languages. - * - * @param SupportedLanguages The supported languages - * @param TargetLanguage The target language - * - * @return Returns EFI_SUCCESS if the language is supported, - * EFI_UNSUPPORTED otherwise - */ + This function checks the supported languages list for a target language, + This only supports RFC 4646 Languages. + + @param SupportedLanguages The supported languages + @param TargetLanguage The target language + + @retval Returns EFI_SUCCESS if the language is supported, + EFI_UNSUPPORTED otherwise + +**/ EFI_STATUS EFIAPI IsLanguageSupported ( -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50662): https://edk2.groups.io/g/devel/message/50662 Mute This Topic: https://groups.io/mt/57476152/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 2/3] NetworkPkg/NetworkPkg.uni: Add missing strings for PCD
From: Shenglei Zhang Cc: Jiaxin Wu Cc: Siyuan Fu Cc: Maciej Rabeda Signed-off-by: Shenglei Zhang --- NetworkPkg/NetworkPkg.uni | 7 +++ 1 file changed, 7 insertions(+) diff --git a/NetworkPkg/NetworkPkg.uni b/NetworkPkg/NetworkPkg.uni index 19e57a4a60de..328d8cb54a6e 100644 --- a/NetworkPkg/NetworkPkg.uni +++ b/NetworkPkg/NetworkPkg.uni @@ -61,6 +61,13 @@ "TRUE - Certificate Authentication feature is enabled.\n" "FALSE - Does not support Certificate Authentication." +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdSnpCreateExitBootServicesEvent_PROMPT #language en-US "Indicates whether SnpDxe creates event for ExitBootServices() call." + +#string STR_gEfiNetworkPkgTokenSpaceGuid_PcdSnpCreateExitBootServicesEvent_HELP #language en-US "Indicates whether SnpDxe driver will create an event that will be notified\n" + "upon gBS->ExitBootServices() call.\n" + "TRUE - Event being triggered upon ExitBootServices call will be created\n" + "FALSE - Event being triggered upon ExitBootServices call will NOT be created" + #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdDhcp6UidType_PROMPT #language en-US "Type Value of Dhcp6 Unique Identifier (DUID)." #string STR_gEfiNetworkPkgTokenSpaceGuid_PcdDhcp6UidType_HELP #language en-US "IPv6 DHCP Unique Identifier (DUID) Type configuration (From RFCs 3315 and 6355).\n" -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50665): https://edk2.groups.io/g/devel/message/50665 Mute This Topic: https://groups.io/mt/57476157/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH 3/3] UefiCpuPkg/UefiCpuPkg.uni: Add missing strings for PCD
From: Shenglei Zhang Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Shenglei Zhang --- UefiCpuPkg/UefiCpuPkg.uni | 16 1 file changed, 16 insertions(+) diff --git a/UefiCpuPkg/UefiCpuPkg.uni b/UefiCpuPkg/UefiCpuPkg.uni index a7e279c5cb14..bfd696f48c35 100644 --- a/UefiCpuPkg/UefiCpuPkg.uni +++ b/UefiCpuPkg/UefiCpuPkg.uni @@ -195,6 +195,22 @@ #string STR_gUefiCpuPkgTokenSpaceGuid_PcdIsPowerOnReset_HELP #language en-US "Indicates if the current boot is a power-on reset." +#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuSmmRestrictedMemoryAccess_PROMPT #language en-US "Access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock." + +#string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuSmmRestrictedMemoryAccess_HELP #language en-US "Indicate access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock.\n" + "MMIO access is always allowed regardless of the value of this PCD.\n" + "Loose of such restriction is only required by RAS components in X64 platforms.\n" + "The PCD value is considered as constantly TRUE in IA32 platforms.\n" + "When the PCD value is TRUE, page table is initialized to cover all memory spaces\n" + "and the memory occupied by page table is protected by page table itself as read-only.\n" + "In X64 build, it cannot be enabled at the same time with SMM profile feature (PcdCpuSmmProfileEnable).\n" + "In X64 build, it could not be enabled also at the same time with heap guard feature for SMM\n" + "(PcdHeapGuardPropertyMask in MdeModulePkg).\n" + "In IA32 build, page table memory is not marked as read-only when either SMM profile feature (PcdCpuSmmProfileEnable)\n" + "or heap guard feature for SMM (PcdHeapGuardPropertyMask in MdeModulePkg) is enabled.\n" + "TRUE - Access to non-SMRAM memory is restricted to reserved, runtime and ACPI NVS type after SmmReadyToLock.\n" + "FALSE - Access to any type of non-SMRAM memory after SmmReadyToLock is allowed." + #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuFeaturesCapability_PROMPT #language en-US "Processor feature capabilities." #string STR_gUefiCpuPkgTokenSpaceGuid_PcdCpuFeaturesCapability_HELP #language en-US "Indicates processor feature capabilities, each bit corresponding to a specific feature." -- 2.18.0.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#50664): https://edk2.groups.io/g/devel/message/50664 Mute This Topic: https://groups.io/mt/57476155/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-