mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
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 <richard.lyu@suse.com>
40 lines
1.1 KiB
INI
40 lines
1.1 KiB
INI
## @file
|
|
# Host-based unit tests for GptLib.
|
|
#
|
|
# Exercises PartitionValidGptTable(), PartitionCheckGptEntry() and
|
|
# PartitionRestoreGptTable() against an in-memory mock disk, covering both
|
|
# well-formed GPT structures and malformed ones an attacker may present.
|
|
#
|
|
# Copyright (c) 2026, SUSE LLC. All rights reserved.<BR>
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
##
|
|
|
|
[Defines]
|
|
INF_VERSION = 0x00010006
|
|
BASE_NAME = GptLibUnitTestHost
|
|
FILE_GUID = 2F5B4C8E-6D3A-4B1F-9E07-8A2C5D14E6B3
|
|
MODULE_TYPE = HOST_APPLICATION
|
|
VERSION_STRING = 1.0
|
|
|
|
#
|
|
# The following information is for reference only and not required by the build tools.
|
|
#
|
|
# VALID_ARCHITECTURES = IA32 X64
|
|
#
|
|
|
|
[Sources]
|
|
GptLibUnitTestCommon.h
|
|
GptLibUnitTestCommon.c
|
|
GptLibUnitTest.c
|
|
|
|
[Packages]
|
|
MdePkg/MdePkg.dec
|
|
MdeModulePkg/MdeModulePkg.dec
|
|
UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec
|
|
|
|
[LibraryClasses]
|
|
BaseLib
|
|
BaseMemoryLib
|
|
DebugLib
|
|
GptLib
|
|
UnitTestLib
|