diff options
| author | Richard Lyu <richard.lyu@suse.com> | 2026-06-30 11:11:36 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-07-21 00:50:57 +0300 |
| commit | 45732edfffcabd8a96d396029e7269875da05407 (patch) | |
| tree | 75e1118f82e51fb477d1cd0b34953852c4292430 /MdeModulePkg/Library/PiDxeS3BootScriptLib | |
| parent | 18407299295f14ea57b8aaa042a750757dfc2151 (diff) | |
| download | edk2-45732edfffcabd8a96d396029e7269875da05407.tar.xz | |
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 <richard.lyu@suse.com>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib')
0 files changed, 0 insertions, 0 deletions
