[edk2-devel] [PATCH 2/5] BaseTools: Generate multiple rules when multiple output files

2020-07-01 Thread PierreGondois
From: Pierre Gondois This patch modifies the Makefile generation not to stop adding Makfile rules when the first final target is found. E.g.: If the following rules are described in build_rule.txt: -[Rule1]: .X files generate .Y and .Z files; -[Rule2]: .Z files generate .Z1 files. Currently,

[edk2-devel] [PATCH v5 1/5] BaseTools: PatchCheck: Exclude bash scripts from CRLF check

2020-07-01 Thread PierreGondois
From: Pierre Gondois Bash scripts require LF line endings to work. PatchCheck.py checks that the files added in a patch have CRLF line endings. It excludes files ending with the ".sh" extension from this check. Some bash script don't have a ".sh" extension. Most of them are located in: -

[edk2-devel] [PATCH v5 5/5] BaseTools: Fix string concatenation

2020-07-01 Thread PierreGondois
From: Pierre Gondois Using Python 3.7.2 on win32, when printing a FileBuildRule instance, the following error occurs: File "edk2\BaseTools\Source\Python\AutoGen\BuildEngine.py", line 177, in __str__ DestString = ", ".join(self.DestFileList) TypeError: sequence item 0: expected str instance,

[edk2-devel] [PATCH v5 3/5] BaseTools: Rename AmlToHex script to AmlToC

2020-07-01 Thread PierreGondois
From: Pierre Gondois The AmlToHex script and Posix/WindowsLike wrappers convert an AML file to a .hex file, containing a C array storing AML bytecode. This ".hex" file can then be included in a C file, allowing to access the AML bytecode from this C file. The EDK2 build system doesn't allow to

[edk2-devel] [PATCH v5 0/5] Compile AML bytecode array into OBJ file

2020-07-01 Thread PierreGondois
Following the BZ at https://bugzilla.tianocore.org/show_bug.cgi?id=2425 This patch serie is a another way to solve the dependency of C files over ASL files. With this new method, the dependency is resolved at the linking stage. The last method to solve this dependency was to add the possibility

[edk2-devel] [PATCH v5 4/5] BaseTools: Compile AML bytecode arrays into .obj file

2020-07-01 Thread PierreGondois
From: Pierre Gondois The AmlToHex script and Posix/WindowsLike wrappers convert an AML file to a .hex file, containing a C array storing AML bytecode. This ".hex" file can then be included in a C file, allowing to access the AML bytecode from this C file. The EDK2 build system doesn't allow to

Re: [edk2-devel] [PATCH] FmpDevicePkg: Enhance capsule verification with secure boot keys

2020-07-01 Thread Liming Sun
>> But if your customer indeed want it, you can add it to your customization >> code. Thanks. Yes, this is a behavior customer expects. This change just tries to provide a handy way to enroll initial keys. So the initial keys could be carried in the capsule itself. It also has

Re: [edk2-devel] [PATCH] FmpDevicePkg: Enhance capsule verification with secure boot keys

2020-07-01 Thread Michael D Kinney
Liming Sun, Can you explain why you cannot use PcdFmpDevicePkcs7CertBufferXdr for your use case? I want to understand the use case to see if that feature can be applied or if a minor enhancement to this feature can work. Using the UEFI Secure Boot DB for anything other than authentication of

[edk2-devel] [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg.dsc: Add DxeAslUpdateLib to Components

2020-07-01 Thread Michael Kubacki
From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2824 Adds DxeAslUpdateLib to the [Components] section so it is included in the package build. Cc: Rangasai V Chaganty Cc: Ray Ni Signed-off-by: Michael Kubacki --- Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 2

[edk2-devel] [PATCH V3] MdePkg: Add Serial Terminal Device Type Guid

2020-07-01 Thread Oleksiy Yakovlev
Add definition of EFI_SERIAL_TERMINAL_DEVICE_TYPE_GUID. It was miseed in "Extend SERIAL_IO with DeviceTypeGuid" patch. (UEFI 2.8, mantis 1832) Signed-off-by: Oleksiy Yakovlev --- MdePkg/Include/Protocol/SerialIo.h | 6 ++ MdePkg/MdePkg.dec | 3 +++ 2 files changed, 9

[edk2-devel] [RFC 2/5] EmbeddedPkg/PrePiLib: drop else if after return

2020-07-01 Thread Leif Lindholm
Simplify FfsProcessSection logic by breaking the continuation of the main loop as a new if statement that executes if the very first test doesn't end up returning. Signed-off-by: Leif Lindholm --- EmbeddedPkg/Library/PrePiLib/FwVol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff

[edk2-devel] [RFC 3/5] EmbeddedPkg/PrePiLib: refactor IS_SECTION2() handling

2020-07-01 Thread Leif Lindholm
There are a bunch of IS_SECTION2() conditional statements in FfsProcessSection, really breaking up the readability. Add a set of static helper functions instead. Signed-off-by: Leif Lindholm --- EmbeddedPkg/Library/PrePiLib/FwVol.c | 101 --- 1 file changed, 61

[edk2-devel] [RFC 0/5] EmbeddedPkg/PrePiLib: rework FfsProcessSection

2020-07-01 Thread Leif Lindholm
https://bugzilla.tianocore.org/show_bug.cgi?id=2820 describes a build failure caused by misanalysis by the compiler, but the problematic code was pretty grotty, so here's an attempt at cleaning it up. This set can also be accessed at:

[edk2-devel] [RFC 5/5] EmbeddedPkg/PrePiLib: break section extraction info into helper function

2020-07-01 Thread Leif Lindholm
Create a new helper function FfsGetExtractionInfo, which handles figuring out the buffer sizes needed for extracting UefiCompressed or GuidedSection sections, and also hides away some of the differences between the two, getting rid of a bunch of local variables. Signed-off-by: Leif Lindholm ---

[edk2-devel] [RFC 4/5] EmbeddedPkg/PrePiLib: drop spurious re-init of CompressedData

2020-07-01 Thread Leif Lindholm
After the refactoring, it is very clear that CompressedData is initialized twice, using exactly the same values. Drop the second one. Signed-off-by: Leif Lindholm --- EmbeddedPkg/Library/PrePiLib/FwVol.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c

[edk2-devel] [RFC 1/5] EmbeddedPkg/PrePiLib: style cleanup in FwVol.c

2020-07-01 Thread Leif Lindholm
Move some curly brackets, change a couple of EFI_D_ to DEBUG_, and fix some intentation. Signed-off-by: Leif Lindholm --- EmbeddedPkg/Library/PrePiLib/FwVol.c | 44 +--- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c

Re: [edk2-devel] [PATCH v6 09/16] MdePkg/MdePkg.ci.yaml: Add configuration for Ecc check

2020-07-01 Thread Liming Gao
Reviewed-by: Liming Gao -Original Message- From: devel@edk2.groups.io On Behalf Of Zhang, Shenglei Sent: 2020年7月1日 9:55 To: devel@edk2.groups.io Cc: Kinney, Michael D ; Gao, Liming Subject: [edk2-devel] [PATCH v6 09/16] MdePkg/MdePkg.ci.yaml: Add configuration for Ecc check Add

Re: [edk2-devel] [PATCH v6 15/16] UefiCpuPkg/UefiCpuPkg.ci.yaml: Add configuration for Ecc check

2020-07-01 Thread Dong, Eric
Reviewed-by: Eric Dong > -Original Message- > From: devel@edk2.groups.io On Behalf Of Zhang, > Shenglei > Sent: Wednesday, July 1, 2020 9:55 AM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Laszlo > Ersek > Subject: [edk2-devel] [PATCH v6 15/16] UefiCpuPkg/UefiCpuPkg.ci.yaml:

Re: [edk2-devel] [PATCH v6 01/16] pip-requirements.txt: Add Ecc required lib

2020-07-01 Thread Liming Gao
Reviewed-by: Liming Gao -Original Message- From: Zhang, Shenglei Sent: 2020年7月1日 9:55 To: devel@edk2.groups.io Cc: Sean Brogan ; Bret Barkelew ; Kinney, Michael D ; Gao, Liming Subject: [PATCH v6 01/16] pip-requirements.txt: Add Ecc required lib antlr4-python3-runtime is a lib to

Re: [edk2-devel] [PATCH v6 04/14] MdeModulePkg: Define the VarCheckPolicyLib and SMM interface

2020-07-01 Thread Dandan Bi
1 comment inline, please check. Thanks, Dandan > -Original Message- > From: devel@edk2.groups.io On Behalf Of Bret > Barkelew > Sent: Tuesday, June 23, 2020 2:41 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Gao, Liming > Subject: [edk2-devel] [PATCH v6 04/14]

Re: [edk2-devel] [PATCH v6 09/14] MdeModulePkg: Connect VariablePolicy business logic to VariableServices

2020-07-01 Thread Dandan Bi
1 comment inline, please check. Thanks, Dandan > -Original Message- > From: devel@edk2.groups.io On Behalf Of Bret > Barkelew > Sent: Tuesday, June 23, 2020 2:41 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Gao, Liming > Subject: [edk2-devel] [PATCH v6 09/14]

Re: [edk2-devel] [PATCH v6 13/14] MdeModulePkg: Drop VarLock from RuntimeDxe variable driver

2020-07-01 Thread Dandan Bi
1 comment inline, please check. Thanks, Dandan > -Original Message- > From: devel@edk2.groups.io On Behalf Of Bret > Barkelew > Sent: Tuesday, June 23, 2020 2:41 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Gao, Liming > Subject: [edk2-devel] [PATCH v6 13/14]

Re: [edk2-devel] [PATCH v6 00/14] Add the VariablePolicy feature

2020-07-01 Thread Dandan Bi
Hi Bret, Thanks for the contribution. I have taken an overview of this patch series and have some small comments in the related patches, please check in sub-patch. I will review the patch series more in details and bring more comments back if have. Do you have a branch for these patches in

[edk2-devel] [PATCH v2 5/9] MdeModulePkg/Core: Create Migrated FV Info Hob for calculating hash (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 When we allocate pool to save rebased the PEIMs, the address will change randomly, therefore the hash will change and result PCR0 change as well. To avoid this, we save the raw PEIMs and use it to calculate hash. Cc: Jian J Wang Cc: Hao A

[edk2-devel] [PATCH v2 1/9] MdeModulePkg/PeiCore: Enable T-RAM evacuation in PeiCore (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 Introduces new changes to PeiCore to move the contents of temporary RAM visible to the PeiCore to permanent memory. This expands on pre-existing shadowing support in the PeiCore to perform the following additional

[edk2-devel] [PATCH v2 4/9] MdeModulePkg/DxeIplPeim: Register for shadow on S3 shadowed boot (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
From: Jian J Wang REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Signed-off-by: Jian J Wang --- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 3 +++ MdeModulePkg/Core/DxeIplPeim/DxeLoad.c | 2 +- 2 files changed, 4

[edk2-devel] [PATCH v2 0/9] Migrate Pointer from flash to permanent memory (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
The TOCTOU vulnerability allow that the physical present person to replace the code with the normal BootGuard check and PCR0 value. The issue occur when BootGuard measure IBB and access flash code after NEM disable. the reason why we access the flash code is that we have some pointer to flash.

[edk2-devel] [PATCH v2 3/9] UefiCpuPkg/SecMigrationPei: Add initial PEIM (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 Adds a PEIM that republishes structures produced in SEC. This is done because SEC modules may not be shadowed in some platforms due to space constraints or special alignment requirements. The SecMigrationPei module

[edk2-devel] [PATCH v2 9/9] UefiCpuPkg/CpuMpPei: Enable paging and set NP flag to avoid TOCTOU (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 To avoid the TOCTOU, enable paging and set Not Present flag so when access any code in the flash range, it will trigger #NP exception. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Signed-off-by: Guomin Jiang ---

[edk2-devel] [PATCH v2 6/9] SecurityPkg/Tcg2Pei: Use Migrated FV Info Hob for calculating hash (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 When we allocate pool to save rebased the PEIMs, the address will change randomly, therefore the hash will change and result PCR0 change as well. To avoid this, we save the raw PEIMs and use it to calculate hash. The Tcg2Pei calculate the

[edk2-devel] [PATCH v2 2/9] UefiCpuPkg/CpuMpPei: Add GDT and IDT migration support (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 Moves the GDT and IDT to permanent memory in a memory discovered callback. This is done to ensure the GDT and IDT authenticated in pre-memory is not fetched from outside a verified location after the permanent memory

[edk2-devel] [PATCH v2 7/9] MdeModulePkg/Core: Add switch to enable or disable TOCTOU feature (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 Add total switch to enable or disable TOCTOU feature, the vulnerability is critical, so the switch is on normally but if you can disable it according to your needs. Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Debkumar

Re: [edk2-devel] [PATCH v2 0/9] Migrate Pointer from flash to permanent memory (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
Hi everybody, I am sorry for bothering you, I just want to reminder you that I want catch those change up next stable tag. So I hope that you can give me some comments or reviewed-by. Appreciate it. > -Original Message- > From: devel@edk2.groups.io On Behalf Of Guomin > Jiang > Sent:

Re: [edk2-devel] [PATCH v6 00/16] Add a plugin to check Ecc issues for edk2 on open ci

2020-07-01 Thread Liming Gao
Shenglei: Thanks for your work to enable ECC checker in open CI. Have you the step to run this checker in local environment? The developer may want to reproduce the issue and fix it. Thanks Liming -Original Message- From: devel@edk2.groups.io On Behalf Of Zhang, Shenglei Sent:

[edk2-devel] [PATCH v2 1/1] MdePkg : UefiFileHandleLib: fix buffer overrun in FileHandleReadLine()

2020-07-01 Thread Vladimir Olovyannikov via groups.io
If the size of the supplied buffer in FileHandleReadLine(), module UefiFileHandleLib.c, was not 0, but was not enough to fit in the line, the size is increased, and then the Buffer of the new size is zeroed. This size is always larger than the supplied buffer size, causing supplied buffer overrun.

Re: [edk2-devel] [PATCH v5 1/5] BaseTools: PatchCheck: Exclude bash scripts from CRLF check

2020-07-01 Thread Bob Feng
Reviewed-by: Bob Feng -Original Message- From: PierreGondois Sent: Wednesday, July 1, 2020 10:06 PM To: devel@edk2.groups.io Cc: Pierre Gondois ; sami.muja...@arm.com; tomas.pi...@arm.com; Feng, Bob C ; Gao, Liming ; n...@arm.com Subject: [PATCH v5 1/5] BaseTools: PatchCheck: Exclude

Re: [edk2-devel] [edk2-staging/Smbios34] ShellPkg/SmbiosView: Add DDR5 support

2020-07-01 Thread Ni, Ray
Reviewed-by: Ray Ni > > -Original Message- > > From: devel@edk2.groups.io On Behalf Of Gao, > Zhichao > > Sent: Friday, March 13, 2020 10:54 AM > > To: devel@edk2.groups.io > > Cc: Ni, Ray > > Subject: [edk2-devel] [edk2-staging/Smbios34] ShellPkg/SmbiosView: Add > DDR5 > > support

Re: [edk2-devel] [PATCH v2 1/1] ShellPkg/DynamicCommand: add HttpDynamicCommand

2020-07-01 Thread Gao, Zhichao
Hi, Sorry for the delay. As I said in the V1, the patch required the NetworkPkg maintainers' help to review the network connection implementation part. Some comments below. 1. for function RunHttp: ''' UINTN StartSize; CHAR16 *Walker; CHAR16 *VStr; ''' The above variable is block

[edk2-devel] [PATCH v2 8/9] UefiCpuPkg/SecMigrationPei: Add switch to control if produce PPI (CVE-2019-11098)

2020-07-01 Thread Guomin Jiang
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 SecMigrationPei create RepublishSecPpi, if the TOCTOU switch is off, the Ppi is meaningless, so relate it with TOCTOU switch to avoid producing useless PPI. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Signed-off-by: Guomin

Re: [edk2-devel] [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg.dsc: Add DxeAslUpdateLib to Components

2020-07-01 Thread Chaganty, Rangasai V
Reviewed-by: Sai Chaganty -Original Message- From: michael.kuba...@outlook.com Sent: Wednesday, July 01, 2020 10:50 AM To: devel@edk2.groups.io Cc: Chaganty, Rangasai V ; Ni, Ray Subject: [edk2-platforms][PATCH v1 1/1] IntelSiliconPkg.dsc: Add DxeAslUpdateLib to Components From: