Date   

Re: [PATCH 2/3] MdeModulePkg/PartitionDxe: Remove the check for special MBR

Gao, Zhichao
 

I also add some variables to calculate StartingLBA and SizeInLBA instead of calculate them when they are needed.
I am fine to revert the whole changes. Just make you aware of this.

Thanks,
Zhichao

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Ni, Ray
Sent: Tuesday, August 11, 2020 4:06 PM
To: Gao, Zhichao <zhichao.gao@...>; devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A <hao.a.wu@...>;
Gary Lin <glin@...>; Andrew Fish <afish@...>
Subject: Re: [edk2-devel] [PATCH 2/3] MdeModulePkg/PartitionDxe: Remove
the check for special MBR

Zhichao,
Can you please just revert the fix you recently added?

-----Original Message-----
From: Gao, Zhichao <zhichao.gao@...>
Sent: Tuesday, August 11, 2020 2:43 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A
<hao.a.wu@...>; Ni, Ray <ray.ni@...>; Gary Lin
<glin@...>; Andrew Fish <afish@...>
Subject: [PATCH 2/3] MdeModulePkg/PartitionDxe: Remove the check for
special MBR

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823

Follow the spec definition, the ISO 9660 (and UDF) would be checked
before the MBR. So it is not required to skip such MBR talbe that
contian the entire block device.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Ray Ni <ray.ni@...>
Cc: Gary Lin <glin@...>
Cc: Andrew Fish <afish@...>
Signed-off-by: Zhichao Gao <zhichao.gao@...>
---
.../Universal/Disk/PartitionDxe/Mbr.c | 19 -------------------
1 file changed, 19 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
index 3830af1ea7..822bf03e92 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
@@ -55,25 +55,6 @@ PartitionValidMbr (
StartingLBA = UNPACK_UINT32 (Mbr->Partition[Index1].StartingLBA);
SizeInLBA = UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA);

- //
- // If the MBR with partition entry covering the ENTIRE disk, i.e. start at
LBA0
- // with whole disk size, we treat it as an invalid MBR partition.
- //
- if ((StartingLBA == 0) &&
- (SizeInLBA == (LastLba + 1))) {
- //
- // Refer to the
http://manpages.ubuntu.com/manpages/bionic/man8/mkudffs.8.html
- // "WHOLE DISK VS PARTITION"
- // Some linux ISOs may put the MBR table in the first 512 bytes for
compatibility reasons with Windows.
- // Linux kernel ignores MBR table if contains partition which starts at
sector 0.
- // Skip it because we don't have the partition check for UDF(El Torito
compatible).
- // It would continue to do the whole disk check in the UDF routine.
- //
- DEBUG ((DEBUG_INFO, "PartitionValidMbr: MBR table has partition entry
covering the ENTIRE disk. Don't treat it as a
valid MBR.\n"));
-
- return FALSE;
- }
-
if (Mbr->Partition[Index1].OSIndicator == 0x00 || SizeInLBA == 0) {
continue;
}
--
2.21.0.windows.1


Re: [edk2-wiki][PATCH v2] Update the Boot Guard TOCTOU wiki page.

Wang, Jian J
 

Hi Guomin,

I'd suggest that you add a section to describe clearly the required steps to
enable this feature in a platform. I just noticed that SecMigrationPei.inf is
not mentioned for doing this.

Regards,
Jian

-----Original Message-----
From: Jiang, Guomin <guomin.jiang@...>
Sent: Tuesday, August 11, 2020 1:32 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Gao, Liming <liming.gao@...>
Subject: [edk2-wiki][PATCH v2] Update the Boot Guard TOCTOU wiki page.

The Boot Guard TOCTOU have been migrated into edk2/master.
Update the document to meet the change.

Signed-off-by: Guomin Jiang <guomin.jiang@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Liming Gao <liming.gao@...>
Reviewed-by: Jian J Wang <jian.j.wang@...>
---
Boot-Guard-TOCTOU-Vulnerability-Mitigation.md | 28 ++++++-------------
1 file changed, 8 insertions(+), 20 deletions(-)

diff --git a/Boot-Guard-TOCTOU-Vulnerability-Mitigation.md b/Boot-Guard-
TOCTOU-Vulnerability-Mitigation.md
index e59c7b1..64b9d66 100644
--- a/Boot-Guard-TOCTOU-Vulnerability-Mitigation.md
+++ b/Boot-Guard-TOCTOU-Vulnerability-Mitigation.md
@@ -45,32 +45,20 @@ references must be updated. In this mitigation, the
process of performing these
The changes described in this mitigation are intended to simply integrate into
firmware solutions. For the changes to
function as intended, the platform firmware implementation should follow
these guidelines.

-The changes are currently being staged in the following EDK II fork for
additional validation before being
-sent to the EDK II mailing list:
https://github.com/makubacki/edk2/tree/btg_toctou_mitigation_staging
-
-The changes should not be considered final or production ready until they are
reviewed and pushed onto edk2/master.
-
-1. Always ensure PcdShadowPeimOnBoot and PcdShadowPeimOnS3Boot
- (if platform supports S3) are set to TRUE if Boot Guard is
- enabled and V=1 or M=1.
-2. Always ensure PcdMigrateTemporaryRamFirmwareVolumes is set to TRUE.
-3. Ensure that all PEIMs are relocatable. Relocation tables should
+1. Always ensure PcdMigrateTemporaryRamFirmwareVolumes is set to TRUE
+ if Boot Guard is enabled and V=1 or M=1.
+2. Ensure that all PEIMs are relocatable. Relocation tables should
not be stripped.
-4. If an Intel&reg; Firmware Support Package (FSP) binary solution is
+3. If an Intel&reg; Firmware Support Package (FSP) binary solution is
used, the binary must have these mitigation changes integrated.
-5. Avoid maintaining pointers to pre-memory addresses inside embedded
+4. Avoid maintaining pointers to pre-memory addresses inside embedded
structures or other non-standard structures that the automatic
migration code introduced in this change cannot identify.
-6. Migrate the FIT table based on platform requirements for FIT
+5. Migrate the FIT table based on platform requirements for FIT
access in post-memory.

-**Very Important**
-
-7. Enable paging after memory initialization and mark the IBB range
- as Not Present (NP).
-
- This will cause a page fault on access to the IBB region. This CR2 register can
be used to identify the address
- accessed and the IP.
+Notes: IBB will be set Not Present, you will see a page fault if any code access
to the IBB region after migration.
+ the address where the code access can be identified in the CR2 register.

# High-Level Migration Required
Resources that must be migrated can be categorized as code or data.
--
2.25.1.windows.1


Re: [PATCH v4 3/5] OvmfPkg: Add RngLib based on TimerLib for Crypto

Ard Biesheuvel
 

On 8/11/20 4:21 AM, matthewfcarlson@... wrote:
From: Matthew Carlson <macarl@...>
How am I supposed to review this change? The commit log is empty and I was not cc'ed on the cover letter.

In general, please try to muster up the energy to write at least one sentence that describes *why* the patch is needed, complementing the subject line, which in this case summarizes correctly *what* the patch does.

Thanks,
Ard.



Cc: Jordan Justen <jordan.l.justen@...>
Cc: Laszlo Ersek <lersek@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Cc: Anthony Perard <anthony.perard@...>
Cc: Julien Grall <julien@...>
Signed-off-by: Matthew Carlson <matthewfcarlson@...>
---
OvmfPkg/OvmfPkgIa32.dsc | 1 +
OvmfPkg/OvmfPkgIa32X64.dsc | 1 +
OvmfPkg/OvmfPkgX64.dsc | 1 +
OvmfPkg/OvmfXen.dsc | 1 +
4 files changed, 4 insertions(+)
diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 9178ffeb71cb..118fd1aff246 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -116,6 +116,7 @@
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
+ RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index a665f78f0dc7..6b9da5b996ff 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -120,6 +120,7 @@
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
+ RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 17f345acf4ee..3a354eb3a2bd 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -120,6 +120,7 @@
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.inf
+ RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf
diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc
index 782803cb2787..f97e2b7e07d0 100644
--- a/OvmfPkg/OvmfXen.dsc
+++ b/OvmfPkg/OvmfXen.dsc
@@ -110,6 +110,7 @@
[LibraryClasses]
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
TimerLib|MdePkg/Library/SecPeiDxeTimerLibCpu/SecPeiDxeTimerLibCpu.inf
+ RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf
ResetSystemLib|OvmfPkg/Library/ResetSystemLib/BaseResetSystemLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
BaseMemoryLib|MdePkg/Library/BaseMemoryLibRepStr/BaseMemoryLibRepStr.inf


Re: [PATCH v9 04/16] ArmVirtPkg/ArmVirtPkg.ci.yaml: Add configuration for Ecc check

Ard Biesheuvel
 

On 8/11/20 9:01 AM, Shenglei Zhang wrote:
Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.
Cc: Laszlo Ersek <lersek@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Cc: Leif Lindholm <leif@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Reviewed-by: Liming Gao <liming.gao@...>
Acked-by: Ard Biesheuvel <ard.biesheuvel@...>

---
ArmVirtPkg/ArmVirtPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/ArmVirtPkg/ArmVirtPkg.ci.yaml b/ArmVirtPkg/ArmVirtPkg.ci.yaml
index 27bb7ff49011..8b2c0305c175 100644
--- a/ArmVirtPkg/ArmVirtPkg.ci.yaml
+++ b/ArmVirtPkg/ArmVirtPkg.ci.yaml
@@ -5,6 +5,7 @@
# used for code analysis.
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
@@ -12,6 +13,17 @@
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
## options defined .pytool/Plugin/CompilerPlugin
"CompilerPlugin": {
"DscPath": "" # Don't support this test


Re: [PATCH 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander

Ni, Ray
 

Reviewed-by: Ray Ni <ray.ni@...>

-----Original Message-----
From: Gao, Zhichao <zhichao.gao@...>
Sent: Tuesday, August 11, 2020 2:43 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A <hao.a.wu@...>; Ni, Ray <ray.ni@...>; Gary Lin
<glin@...>; Andrew Fish <afish@...>
Subject: [PATCH 3/3] MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2843

PartitionInstallChildHandle's parameters Start and End is counted
by the BlockSize, but in the implementation it uses the parent
device's BlockSize to calculate the new Start, End and LastBlock.
It would cause the driver report incorrect block scope and the file
system would fail to be found with right block scope.
So correct it to the right value.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Ray Ni <ray.ni@...>
Cc: Gary Lin <glin@...>
Cc: Andrew Fish <afish@...>
Signed-off-by: Zhichao Gao <zhichao.gao@...>
---
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
index 473e091320..f10ce7c65b 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
@@ -1149,8 +1149,8 @@ PartitionInstallChildHandle (

Private->Signature = PARTITION_PRIVATE_DATA_SIGNATURE;

- Private->Start = MultU64x32 (Start, ParentBlockIo->Media->BlockSize);
- Private->End = MultU64x32 (End + 1, ParentBlockIo->Media->BlockSize);
+ Private->Start = MultU64x32 (Start, BlockSize);
+ Private->End = MultU64x32 (End + 1, BlockSize);

Private->BlockSize = BlockSize;
Private->ParentBlockIo = ParentBlockIo;
@@ -1187,13 +1187,7 @@ PartitionInstallChildHandle (

Private->Media.IoAlign = 0;
Private->Media.LogicalPartition = TRUE;
- Private->Media.LastBlock = DivU64x32 (
- MultU64x32 (
- End - Start + 1,
- ParentBlockIo->Media->BlockSize
- ),
- BlockSize
- ) - 1;
+ Private->Media.LastBlock = End - Start;

Private->Media.BlockSize = (UINT32) BlockSize;

--
2.21.0.windows.1


Re: [PATCH 2/3] MdeModulePkg/PartitionDxe: Remove the check for special MBR

Ni, Ray
 

Zhichao,
Can you please just revert the fix you recently added?

-----Original Message-----
From: Gao, Zhichao <zhichao.gao@...>
Sent: Tuesday, August 11, 2020 2:43 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A <hao.a.wu@...>; Ni, Ray <ray.ni@...>; Gary Lin
<glin@...>; Andrew Fish <afish@...>
Subject: [PATCH 2/3] MdeModulePkg/PartitionDxe: Remove the check for special MBR

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823

Follow the spec definition, the ISO 9660 (and UDF) would be
checked before the MBR. So it is not required to skip such
MBR talbe that contian the entire block device.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Ray Ni <ray.ni@...>
Cc: Gary Lin <glin@...>
Cc: Andrew Fish <afish@...>
Signed-off-by: Zhichao Gao <zhichao.gao@...>
---
.../Universal/Disk/PartitionDxe/Mbr.c | 19 -------------------
1 file changed, 19 deletions(-)

diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
index 3830af1ea7..822bf03e92 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Mbr.c
@@ -55,25 +55,6 @@ PartitionValidMbr (
StartingLBA = UNPACK_UINT32 (Mbr->Partition[Index1].StartingLBA);
SizeInLBA = UNPACK_UINT32 (Mbr->Partition[Index1].SizeInLBA);

- //
- // If the MBR with partition entry covering the ENTIRE disk, i.e. start at LBA0
- // with whole disk size, we treat it as an invalid MBR partition.
- //
- if ((StartingLBA == 0) &&
- (SizeInLBA == (LastLba + 1))) {
- //
- // Refer to the http://manpages.ubuntu.com/manpages/bionic/man8/mkudffs.8.html
- // "WHOLE DISK VS PARTITION"
- // Some linux ISOs may put the MBR table in the first 512 bytes for compatibility reasons with Windows.
- // Linux kernel ignores MBR table if contains partition which starts at sector 0.
- // Skip it because we don't have the partition check for UDF(El Torito compatible).
- // It would continue to do the whole disk check in the UDF routine.
- //
- DEBUG ((DEBUG_INFO, "PartitionValidMbr: MBR table has partition entry covering the ENTIRE disk. Don't treat it as a
valid MBR.\n"));
-
- return FALSE;
- }
-
if (Mbr->Partition[Index1].OSIndicator == 0x00 || SizeInLBA == 0) {
continue;
}
--
2.21.0.windows.1


Re: [PATCH 1/3] MdeModulePkg/PartitionDxe: Put the UDF check ahead of MBR

Ni, Ray
 

Zhichao,
Can you also add notes in the commit message describing that for some ISOs (better with more specific ISO info), the MBR information is not correct?

Thanks,
Ray

-----Original Message-----
From: Gao, Zhichao <zhichao.gao@...>
Sent: Tuesday, August 11, 2020 2:43 PM
To: devel@edk2.groups.io
Cc: Wang, Jian J <jian.j.wang@...>; Wu, Hao A <hao.a.wu@...>; Ni, Ray <ray.ni@...>; Gary Lin
<glin@...>; Andrew Fish <afish@...>
Subject: [PATCH 1/3] MdeModulePkg/PartitionDxe: Put the UDF check ahead of MBR

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823

Refer to UEFI spec 2.8, Section 13.3.2, a block device should
be scanned as below order:
1. GPT
2. ISO 9660 (El Torito) (UDF should aslo be here)
3. MBR
4. no partition found
Note: UDF is using the same boot method as CD, so put it in
the same priority with ISO 9660.

This would also solve the issue that ISO image with MBR would
be treat as MBR device instead of CD/DVD. That would make the
behavior of the image boot different.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Ray Ni <ray.ni@...>
Cc: Gary Lin <glin@...>
Cc: Andrew Fish <afish@...>
Signed-off-by: Zhichao Gao <zhichao.gao@...>
---
MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
index 6a43c3cafb..473e091320 100644
--- a/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
+++ b/MdeModulePkg/Universal/Disk/PartitionDxe/Partition.c
@@ -35,11 +35,19 @@ EFI_DRIVER_BINDING_PROTOCOL gPartitionDriverBinding = {

//
// Prioritized function list to detect partition table.
+// Refer to UEFI Spec 13.3.2 Partition Discovery, the block device
+// should be scanned in below order:
+// 1. GPT
+// 2. ISO 9660 (El Torito) (or UDF)
+// 3. MBR
+// 4. no partiton found
+// Note: UDF is using a same method as booting from CD-ROM, so put it along
+// with CD-ROM check.
//
PARTITION_DETECT_ROUTINE mPartitionDetectRoutineTable[] = {
PartitionInstallGptChildHandles,
- PartitionInstallMbrChildHandles,
PartitionInstallUdfChildHandles,
+ PartitionInstallMbrChildHandles,
NULL
};

--
2.21.0.windows.1


Re: [PATCH 0/3] MdeModulePkg/PartitionDxe: Make the parition driver match the spec

Gary Lin
 

On Tue, Aug 11, 2020 at 02:42:59PM +0800, Zhichao Gao wrote:
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2823
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2843

Refer to the UEFI spec 2.8, Section 13.3.2:
A block device should be scanned as below order:
1. GPT
2. ISO 9660 (El Torito) (UDF should aslo be here)
4. MBR
5. no partition found

But the code implementation is:
1. GPT
2. MBR
3. ISO 9660 (El Torito) (UDF)
4. no partition found

Which would cause the ISO 9960 image with MBR info be treated as MBR
device. That would cause unexpect behavior. So fix it to follow the spec
description.

The fix of the PartitionInstallChildHandle would change the boot behavior
of Linux ISO image with MBR table. So add it after the order adjustment
to make no impact of the boot.
Thanks for the patches. After applying this patch series, the firmware
recognizes openSUSE/SUSE iso images again.

Tested-by: Gary Lin <glin@...>

Cc: Jian J Wang <jian.j.wang@...>
Cc: Hao A Wu <hao.a.wu@...>
Cc: Ray Ni <ray.ni@...>
Cc: Gary Lin <glin@...>
Cc: Andrew Fish <afish@...>
Signed-off-by: Zhichao Gao <zhichao.gao@...>
Zhichao Gao (3):
MdeModulePkg/PartitionDxe: Put the UDF check ahead of MBR
MdeModulePkg/PartitionDxe: Remove the check for special MBR
MdeModulePkg/PartitionDxe: Fix the incorrect LBA size in child hander

.../Universal/Disk/PartitionDxe/Mbr.c | 19 ----------------
.../Universal/Disk/PartitionDxe/Partition.c | 22 ++++++++++---------
2 files changed, 12 insertions(+), 29 deletions(-)

--
2.21.0.windows.1


[PATCH v9 16/16] UnitTestFrameworkPkg: Add configuration for Ecc check in yaml file

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.
Besides, add submodule path in IgnoreFiles section.

Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Sean Brogan <sean.brogan@...>
Cc: Bret Barkelew <Bret.Barkelew@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
---
UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml
index fc5b3b387664..9e9ffc1af113 100644
--- a/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml
+++ b/UnitTestFrameworkPkg/UnitTestFrameworkPkg.ci.yaml
@@ -9,6 +9,18 @@
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ "Library/CmockaLib/cmocka"
+ ]
+ },
## options defined .pytool/Plugin/CompilerPlugin
"CompilerPlugin": {
"DscPath": "UnitTestFrameworkPkg.dsc"
--
2.18.0.windows.1


[PATCH v9 15/16] UefiCpuPkg/UefiCpuPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Eric Dong <eric.dong@...>
Cc: Ray Ni <ray.ni@...>
Cc: Laszlo Ersek <lersek@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Acked-by: Ray Ni <ray.ni@...>
Reviewed-by: Eric Dong <eric.dong@...>
Acked-by: Laszlo Ersek <lersek@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
UefiCpuPkg/UefiCpuPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/UefiCpuPkg/UefiCpuPkg.ci.yaml b/UefiCpuPkg/UefiCpuPkg.ci.yaml
index d54651d43800..48ab710438a9 100644
--- a/UefiCpuPkg/UefiCpuPkg.ci.yaml
+++ b/UefiCpuPkg/UefiCpuPkg.ci.yaml
@@ -2,12 +2,24 @@
# CI configuration for UefiCpuPkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
"CompilerPlugin": {
"DscPath": "UefiCpuPkg.dsc"
},
--
2.18.0.windows.1


[PATCH v9 14/16] ShellPkg/ShellPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Ray Ni <ray.ni@...>
Cc: Zhichao Gao <zhichao.gao@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Acked-by: Ray Ni <ray.ni@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
ShellPkg/ShellPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/ShellPkg/ShellPkg.ci.yaml b/ShellPkg/ShellPkg.ci.yaml
index 565e08596b2f..30894d44bc3a 100644
--- a/ShellPkg/ShellPkg.ci.yaml
+++ b/ShellPkg/ShellPkg.ci.yaml
@@ -2,12 +2,24 @@
# CI configuration for ShellPkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
"CompilerPlugin": {
"DscPath": "ShellPkg.dsc"
},
--
2.18.0.windows.1


[PATCH v9 13/16] SecurityPkg/SecurityPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Jiewen Yao <jiewen.yao@...>
Cc: Jian J Wang <jian.j.wang@...>
Cc: Chao Zhang <chao.b.zhang@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Reviewed-by: Jian J Wang <jian.j.wang@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
SecurityPkg/SecurityPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/SecurityPkg/SecurityPkg.ci.yaml b/SecurityPkg/SecurityPkg.ci.yaml
index 1ef1d2e67ead..03be2e94ca97 100644
--- a/SecurityPkg/SecurityPkg.ci.yaml
+++ b/SecurityPkg/SecurityPkg.ci.yaml
@@ -2,12 +2,24 @@
# CI configuration for SecurityPkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
"CompilerPlugin": {
"DscPath": "SecurityPkg.dsc"
},
--
2.18.0.windows.1


[PATCH v9 12/16] PcAtChipsetPkg/PcAtChipsetPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Ray Ni <ray.ni@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Acked-by: Ray Ni <ray.ni@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
PcAtChipsetPkg/PcAtChipsetPkg.ci.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/PcAtChipsetPkg/PcAtChipsetPkg.ci.yaml b/PcAtChipsetPkg/PcAtChipsetPkg.ci.yaml
index 5543d15c3248..61f3fd7b5074 100644
--- a/PcAtChipsetPkg/PcAtChipsetPkg.ci.yaml
+++ b/PcAtChipsetPkg/PcAtChipsetPkg.ci.yaml
@@ -2,12 +2,25 @@
# CI configuration for PcAtChipsetPkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
+ ## options defined .pytool/Plugin/LicenseCheck
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
"CompilerPlugin": {
"DscPath": "PcAtChipsetPkg.dsc"
},
--
2.18.0.windows.1


[PATCH v9 11/16] OvmfPkg/OvmfPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Jordan Justen <jordan.l.justen@...>
Cc: Laszlo Ersek <lersek@...>
Cc: Ard Biesheuvel <ard.biesheuvel@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Acked-by: Laszlo Ersek <lersek@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
OvmfPkg/OvmfPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/OvmfPkg/OvmfPkg.ci.yaml b/OvmfPkg/OvmfPkg.ci.yaml
index ed342d7a3d08..3128aefe9ed1 100644
--- a/OvmfPkg/OvmfPkg.ci.yaml
+++ b/OvmfPkg/OvmfPkg.ci.yaml
@@ -5,6 +5,7 @@
# used for code analysis.
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
@@ -12,6 +13,17 @@
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
## options defined .pytool/Plugin/CompilerPlugin
"CompilerPlugin": {
"DscPath": "" # Don't support this test
--
2.18.0.windows.1


[PATCH v9 10/16] NetworkPkg/NetworkPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Maciej Rabeda <maciej.rabeda@...>
Cc: Jiaxin Wu <jiaxin.wu@...>
Cc: Siyuan Fu <siyuan.fu@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Reviewed-by: Maciej Rabeda <maciej.rabeda@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
NetworkPkg/NetworkPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/NetworkPkg/NetworkPkg.ci.yaml b/NetworkPkg/NetworkPkg.ci.yaml
index aa536830fc27..1a3ab71792d1 100644
--- a/NetworkPkg/NetworkPkg.ci.yaml
+++ b/NetworkPkg/NetworkPkg.ci.yaml
@@ -2,12 +2,24 @@
# CI configuration for NetworkPkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
"CompilerPlugin": {
"DscPath": "NetworkPkg.dsc"
},
--
2.18.0.windows.1


[PATCH v9 09/16] MdePkg/MdePkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Michael D Kinney <michael.d.kinney@...>
Cc: Liming Gao <liming.gao@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
MdePkg/MdePkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/MdePkg/MdePkg.ci.yaml b/MdePkg/MdePkg.ci.yaml
index b088a4344908..15931eaccabf 100644
--- a/MdePkg/MdePkg.ci.yaml
+++ b/MdePkg/MdePkg.ci.yaml
@@ -2,6 +2,7 @@
# CI configuration for MdePkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
@@ -9,6 +10,17 @@
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
## options defined ci/Plugin/CompilerPlugin
"CompilerPlugin": {
"DscPath": "MdePkg.dsc"
--
2.18.0.windows.1


[PATCH v9 08/16] FmpDevicePkg/FmpDevicePkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Liming Gao <liming.gao@...>
Cc: Michael D Kinney <michael.d.kinney@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Reviewed-by: Guomin Jiang <guomin.jiang@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
FmpDevicePkg/FmpDevicePkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/FmpDevicePkg/FmpDevicePkg.ci.yaml b/FmpDevicePkg/FmpDevicePkg.ci.yaml
index d498ad7d21e1..1b3e2187356d 100644
--- a/FmpDevicePkg/FmpDevicePkg.ci.yaml
+++ b/FmpDevicePkg/FmpDevicePkg.ci.yaml
@@ -2,12 +2,24 @@
# CI configuration for FmpDevicePkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
"CompilerPlugin": {
"DscPath": "FmpDevicePkg.dsc"
},
--
2.18.0.windows.1


[PATCH v9 07/16] FatPkg/FatPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Ray Ni <ray.ni@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Reviewed-by: Guomin Jiang <guomin.jiang@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
FatPkg/FatPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/FatPkg/FatPkg.ci.yaml b/FatPkg/FatPkg.ci.yaml
index 489c4614e9e1..fe95f481b50c 100644
--- a/FatPkg/FatPkg.ci.yaml
+++ b/FatPkg/FatPkg.ci.yaml
@@ -2,12 +2,24 @@
# CI configuration for FatPkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
"CompilerPlugin": {
"DscPath": "FatPkg.dsc"
},
--
2.18.0.windows.1


[PATCH v9 06/16] EmulatorPkg/EmulatorPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.

Cc: Jordan Justen <jordan.l.justen@...>
Cc: Andrew Fish <afish@...>
Cc: Ray Ni <ray.ni@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
Acked-by: Ray Ni <ray.ni@...>
Reviewed-by: Liming Gao <liming.gao@...>
---
EmulatorPkg/EmulatorPkg.ci.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/EmulatorPkg/EmulatorPkg.ci.yaml b/EmulatorPkg/EmulatorPkg.ci.yaml
index dead82f69745..980844c1fdd4 100644
--- a/EmulatorPkg/EmulatorPkg.ci.yaml
+++ b/EmulatorPkg/EmulatorPkg.ci.yaml
@@ -5,6 +5,7 @@
# used for code analysis.
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
@@ -12,6 +13,17 @@
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
## options defined .pytool/Plugin/CompilerPlugin
"CompilerPlugin": {
"DscPath": "" # Don't support this test
--
2.18.0.windows.1


[PATCH v9 05/16] CryptoPkg/CryptoPkg.ci.yaml: Add configuration for Ecc check

Zhang, Shenglei
 

Add configuration ExceptionList and IgnoreFiles for package config
files. So users can rely on this to ignore some Ecc issues.
Besides, add submodule path in IgnoreFiles section.

Cc: Jian J Wang <jian.j.wang@...>
Cc: Xiaoyu Lu <xiaoyux.lu@...>
Signed-off-by: Shenglei Zhang <shenglei.zhang@...>
---
CryptoPkg/CryptoPkg.ci.yaml | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/CryptoPkg/CryptoPkg.ci.yaml b/CryptoPkg/CryptoPkg.ci.yaml
index e73b79e01fef..e2d190a90c51 100644
--- a/CryptoPkg/CryptoPkg.ci.yaml
+++ b/CryptoPkg/CryptoPkg.ci.yaml
@@ -2,12 +2,25 @@
# CI configuration for CryptoPkg
#
# Copyright (c) Microsoft Corporation
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
{
"LicenseCheck": {
"IgnoreFiles": []
},
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ "ExceptionList": [
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ "Library/OpensslLib/openssl"
+ ]
+ },
"CompilerPlugin": {
"DscPath": "CryptoPkg.dsc"
},
--
2.18.0.windows.1