Branch: refs/heads/master
  Home:   https://github.com/tianocore/edk2
  Commit: 00a865d595591fef44dc9f23353f5c3d50152e04
      
https://github.com/tianocore/edk2/commit/00a865d595591fef44dc9f23353f5c3d50152e04
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    A MdeModulePkg/Include/Library/GptLib.h
    A MdeModulePkg/Library/GptLib/Gpt.c
    A MdeModulePkg/Library/GptLib/GptLib.inf
    M MdeModulePkg/MdeModulePkg.dec
    M MdeModulePkg/MdeModulePkg.dsc
    M MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c
    M MdeModulePkg/Universal/Disk/PartitionDxe/Partition.h
    M MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf

  Log Message:
  -----------
  MdeModulePkg/GptLib: Extract shareable GPT parser into a library

As reported in CVE-2024-13745 via oss-sec, DxeTpm2MeasureBootLib can
measure a partition table that differs from the one parsed by the
PartitionDxe driver.

To address this, the more complete GPT parsing logic from PartitionDxe
is extracted into a standalone GptLib library so it can be
shared between PartitionDxe and DxeTpm2MeasureBootLib. This ensures
that the exact same partition table measured into PCR[5] is the one
parsed and used by the system. PartitionDxe behavior is unchanged.

Ref: https://seclists.org/oss-sec/2026/q2/727
Signed-off-by: Richard Lyu <[email protected]>


  Commit: 7c12d4359abd47901f3aa9e1e8bb11c2aed8155e
      
https://github.com/tianocore/edk2/commit/7c12d4359abd47901f3aa9e1e8bb11c2aed8155e
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.c
    M SecurityPkg/Library/DxeTpm2MeasureBootLib/DxeTpm2MeasureBootLib.inf
    M SecurityPkg/SecurityPkg.dsc

  Log Message:
  -----------
  SecurityPkg/DxeTpm2MeasureBootLib: Use GptLib parser

The previous commit introduced GptLib by extracting PartitionDxe's GPT
parsing and validation code. It provides a shared implementation for edk2
components that need to parse and validate GPT data consistently.

Update DxeTpm2MeasureBootLib to use GptLib when selecting on-disk GPT
data for measurement. Validate the current primary GPT or, when it is
invalid, validate the backup and the header at its AlternateLBA. Do not
extend PCR[5] if no valid header can be selected. The measurement therefore
uses GPT data read from disk at measurement time and applies the shared
parser and validation logic.

Ref: https://seclists.org/oss-sec/2026/q2/727
Signed-off-by: Richard Lyu <[email protected]>


  Commit: 2b27f795ec11e8de70fc284732656f19e50d0a32
      
https://github.com/tianocore/edk2/commit/2b27f795ec11e8de70fc284732656f19e50d0a32
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M ArmVirtPkg/ArmVirt.dsc.inc

  Log Message:
  -----------
  ArmVirtPkg: Resolve GptLib library class

GptLib is a new library class consumed both by PartitionDxe (built by
essentially every platform) and by DxeTpm2MeasureBootLib. Any platform DSC
that builds either module must resolve the GptLib library class, otherwise
the build fails with "Instance of library class [GptLib] is not found".

Resolve GptLib once in ArmVirtPkg/ArmVirt.dsc.inc for the whole ArmVirt
family, whose platforms build PartitionDxe and, for ArmVirtQemu, link
DxeTpm2MeasureBootLib.

Out-of-tree platforms consuming either module need the same one-line
resolution.

Signed-off-by: Richard Lyu <[email protected]>


  Commit: 78c5050bb2480c87d810119205e6440a66a9189f
      
https://github.com/tianocore/edk2/commit/78c5050bb2480c87d810119205e6440a66a9189f
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M EmulatorPkg/EmulatorPkg.dsc

  Log Message:
  -----------
  EmulatorPkg: Resolve GptLib library class

GptLib is a new library class consumed both by PartitionDxe (built by
essentially every platform) and by DxeTpm2MeasureBootLib. Any platform DSC
that builds either module must resolve the GptLib library class, otherwise
the build fails with "Instance of library class [GptLib] is not found".

Resolve GptLib in EmulatorPkg/EmulatorPkg.dsc, which builds PartitionDxe.

Out-of-tree platforms consuming either module need the same one-line
resolution.

Signed-off-by: Richard Lyu <[email protected]>


  Commit: cb6dcca33737a736382279fda931c5cc4a3dc03d
      
https://github.com/tianocore/edk2/commit/cb6dcca33737a736382279fda931c5cc4a3dc03d
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M OvmfPkg/AmdSev/AmdSevX64.dsc
    M OvmfPkg/Bhyve/BhyveX64.dsc
    M OvmfPkg/CloudHv/CloudHvX64.dsc
    M OvmfPkg/IntelTdx/IntelTdxX64.dsc
    M OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc
    M OvmfPkg/Microvm/MicrovmX64.dsc
    M OvmfPkg/OvmfPkgIa32X64.dsc
    M OvmfPkg/OvmfPkgX64.dsc
    M OvmfPkg/OvmfXen.dsc
    M OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc

  Log Message:
  -----------
  OvmfPkg: Resolve GptLib library class

GptLib is a new library class consumed both by PartitionDxe (built by
essentially every platform) and by DxeTpm2MeasureBootLib. Any platform DSC
that builds either module must resolve the GptLib library class, otherwise
the build fails with "Instance of library class [GptLib] is not found".

Resolve GptLib in each OVMF DSC. Every OVMF DSC builds PartitionDxe.
IntelTdx, LoongArchVirt and RiscVVirt additionally link
DxeTpm2MeasureBootLib directly; AmdSev, Bhyve, CloudHv, Microvm,
OvmfPkgX64 and OvmfPkgIa32X64 pull it in through
OvmfTpmSecurityStub.dsc.inc.

Out-of-tree platforms consuming either module need the same one-line
resolution.

Signed-off-by: Richard Lyu <[email protected]>


  Commit: 18407299295f14ea57b8aaa042a750757dfc2151
      
https://github.com/tianocore/edk2/commit/18407299295f14ea57b8aaa042a750757dfc2151
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M UefiPayloadPkg/UefiPayloadPkg.dsc

  Log Message:
  -----------
  UefiPayloadPkg: Resolve GptLib library class

GptLib is a new library class consumed both by PartitionDxe (built by
essentially every platform) and by DxeTpm2MeasureBootLib. Any platform DSC
that builds either module must resolve the GptLib library class, otherwise
the build fails with "Instance of library class [GptLib] is not found".

Resolve GptLib in UefiPayloadPkg/UefiPayloadPkg.dsc, which builds
PartitionDxe.

Out-of-tree platforms consuming either module need the same one-line
resolution.

Signed-off-by: Richard Lyu <[email protected]>


  Commit: 45732edfffcabd8a96d396029e7269875da05407
      
https://github.com/tianocore/edk2/commit/45732edfffcabd8a96d396029e7269875da05407
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M MdeModulePkg/Library/GptLib/Gpt.c

  Log Message:
  -----------
  MdeModulePkg/GptLib: Validate GPT header fields before use

PartitionValidGptTable() checked the signature, header CRC32, MyLBA, the
entry-array CRC32 and the entry-array size overflow, but not several other
UEFI-mandated GPT header constraints. DxeTpm2MeasureBootLib used to enforce
these via Tpm2SanitizeEfiPartitionTableHeader(); once it switched to this
shared parser, the checks were lost on the path.

Also reject a header unless Header.Revision is GPT_HEADER_REVISION_V1,
HeaderSize is at least the 92-byte minimum, NumberOfPartitionEntries is
non-zero, SizeOfPartitionEntry is 128 * 2^n, and PartitionEntryLBA *
BlockSize cannot overflow. The "entries lie before FirstUsableLBA" rule is
intentionally omitted, as this routine also validates the backup header
whose entry array follows the usable region.

This restores the validation the measurement path lost and, because GptLib
is shared, tightens PartitionDxe the same way: malformed headers are now
rejected and the parse and measure paths stay identical.

Ref: https://seclists.org/oss-sec/2026/q2/727
Signed-off-by: Richard Lyu <[email protected]>


  Commit: 070c9026f754b2c0b88445c8638eed0609673ccc
      
https://github.com/tianocore/edk2/commit/070c9026f754b2c0b88445c8638eed0609673ccc
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M MdeModulePkg/Universal/Disk/PartitionDxe/Gpt.c

  Log Message:
  -----------
  MdeModulePkg/PartitionDxe: Abort on primary GPT recovery failure

When the primary GPT is invalid, PartitionInstallGptChildHandles()
restores it from the backup and re-validates it. Both the restore write
and the re-validation can fail (e.g. write-protected media, or a backup
AlternateLBA pointing beyond the device), yet the existing code only logs
the failure and parses partitions from a known-invalid PrimaryHeader.

Abort GPT processing when either the restore or the validation fails, so
partitions are only ever parsed from a validated primary GPT. The backup
recovery branch is left unchanged, as the primary is already validated.

A device with an unrecoverable primary GPT now installs no child handles
instead of using an invalid header. This keeps the table PartitionDxe uses
in sync with the one DxeTpm2MeasureBootLib measures into PCR[5].

Ref: https://seclists.org/oss-sec/2026/q2/727
Signed-off-by: Richard Lyu <[email protected]>


  Commit: b65fd21591230233f53d2cfb22c42d4605054902
      
https://github.com/tianocore/edk2/commit/b65fd21591230233f53d2cfb22c42d4605054902
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.c
    M SecurityPkg/Library/DxeTpmMeasureBootLib/DxeTpmMeasureBootLib.inf

  Log Message:
  -----------
  SecurityPkg/DxeTpmMeasureBootLib: Use GptLib parser

TcgMeasureGptTable() reads the primary GPT header directly from LBA 1
and validates it with field checks only: no header CRC32, no
partition-entry-array CRC32 and no backup fallback. This is the same
divergence between the measured and the parsed partition table that
CVE-2024-13745 reports against DxeTpm2MeasureBootLib, and the tracking
issue lists both libraries as affected.

Mirror the DxeTpm2MeasureBootLib fix: select the GPT header to measure
via the shared GptLib parser. Validate the current primary GPT or, when
it is invalid, validate the backup and the header at its AlternateLBA.
Do not extend PCR[5] if no valid header can be selected.

Signed-off-by: Richard Lyu <[email protected]>


  Commit: 77585e50049839856baed37d120d4f705a2cf1d0
      
https://github.com/tianocore/edk2/commit/77585e50049839856baed37d120d4f705a2cf1d0
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    A MdeModulePkg/Library/GptLib/UnitTest/GptLibUnitTest.c
    A MdeModulePkg/Library/GptLib/UnitTest/GptLibUnitTestCommon.c
    A MdeModulePkg/Library/GptLib/UnitTest/GptLibUnitTestCommon.h
    A MdeModulePkg/Library/GptLib/UnitTest/GptLibUnitTestHost.inf
    M MdeModulePkg/MdeModulePkg.ci.yaml
    M MdeModulePkg/Test/MdeModulePkgHostTest.dsc

  Log Message:
  -----------
  MdeModulePkg/GptLib: Add host-based unit tests for valid GPT behavior

Add the positive-path host-based tests for the shared GptLib parser
(extracted as part of the parser security hardening), ensuring the
tightened checks in PartitionValidGptTable(), PartitionCheckGptEntry()
and PartitionRestoreGptTable() do not falsely reject well-formed GPTs.

The tests run against an in-memory mock disk and cover accepted
primary/backup headers, boundary but legal header/entry sizes, correct
entry-status flagging on valid entries, and primary/backup restore
round-trips.

Signed-off-by: Richard Lyu <[email protected]>


  Commit: b1029265b1459a4021df8e7495daf281df3344ef
      
https://github.com/tianocore/edk2/commit/b1029265b1459a4021df8e7495daf281df3344ef
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M MdeModulePkg/Library/GptLib/UnitTest/GptLibUnitTest.c
    M MdeModulePkg/Library/GptLib/UnitTest/GptLibUnitTestHost.inf

  Log Message:
  -----------
  MdeModulePkg/GptLib: Add host-based unit tests for malformed GPT input

Extend the GptLib host-based tests with negative cases that guard the
security hardening in PartitionValidGptTable(), PartitionCheckGptEntry()
and PartitionRestoreGptTable() against future regressions. These tests
exercise the shared parser, not the specific fix itself.

The new cases drive the parser with malformed GPT structures that an
attacker may present: bad signature/revision, header-size boundaries,
CRC corruption, MyLBA replay, zero/non-power-of-two entry sizes, LBA
multiplication overflow, out-of-range and overlapping entries, and
restore failure on write-protected media. The INF file header is
updated to note the added malformed coverage.

Signed-off-by: Richard Lyu <[email protected]>


  Commit: 0e13e105c625810b816dbed199f0f9520d6611a0
      
https://github.com/tianocore/edk2/commit/0e13e105c625810b816dbed199f0f9520d6611a0
  Author: Richard Lyu <[email protected]>
  Date:   2026-07-20 (Mon, 20 Jul 2026)

  Changed paths:
    M BREAKING-CHANGES.md

  Log Message:
  -----------
  BREAKING-CHANGES.md: Document GptLib library class addition

Per the Breaking Change and Release Process RFC, a non-removal breaking
change must add an entry to BREAKING-CHANGES.md in the PR that introduces
the change.

Add the entry for the new GptLib library class dependency under
edk2-stable202608, Source-Level Breaking Changes, Changes without Removal.

Signed-off-by: Richard Lyu <[email protected]>


Compare: https://github.com/tianocore/edk2/compare/2938b830f61d...0e13e105c625

To unsubscribe from these emails, change your notification settings at 
https://github.com/tianocore/edk2/settings/notifications


_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to