| Age | Commit message (Collapse) | Author | Files | Lines |
|
Update the Brotli submodule to v1.2.1
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
Remove the duplicate OptionOrder free on reallocation failure in
EfiBootManagerGetLoadOptions().
Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
|
|
Free the previous GOP device path pool only once when the recursive
search returns a path to append. If it returns NULL, preserve paths
collected from earlier children instead of freeing the pool.
Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
|
|
The existing ArmCcaLib instance uses GUID HOBs to read the cached
IsRealm status and Realm IPA width. This does not work during early SEC
execution, where GetHobList() can fail because the HOB list has not yet
been set up.
Split the direct RSI query helpers into common code and add an early
ArmCcaLib instance for SEC and PEI users. The early instance implements
ArmCcaIsRealm() and ArmCcaGetIpaWidth() by querying RSI directly,
without relying on cached HOB data.
Keep the existing ArmCcaLib instance for DXE and later phases, where the
cached HOB values can be used. Also make ArmCcaMemRangeIsProtectedMmio()
return RETURN_UNSUPPORTED when called outside a Realm.
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
|
|
Replace HandleProtocol with OpenProtocol using
EFI_OPEN_PROTOCOL_GET_PROTOCOL in SmmCorePerformanceLib.
Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
|
|
SMM images without embedded PDB paths trigger a UI-name fallback
that incorrectly treats PiSmmCore's private-context pointer as a
DXE image handle, causing an assertion or invalid memory access.
Read the UI section from the target image's firmware-volume
DeviceHandle instead.
Signed-off-by: Anbazhagan Baraneedharan <anbazhagan@hp.com>
|
|
Several places in MdeModulePkg were implementing their
own versions of hex dumping logic; use the DebugLib.h
macro instead.
Prints change slightly, they are now standardized with
uppercase hex, prefixes on every row instead of in the
header only, and VarCheckHiiLib no longer indents rows
with *ASCII*.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
|
|
Enable printing EFI_HOB_TYPE_RESOURCE_DESCRIPTOR2 type hobs
from HobPrintLib.
PrintResourceDiscriptorHob was misspelled.
While adding Descriptor2 support, fix up spelling of Descriptor
in existing function.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
Add BuildResourceDescriptor2Hob to HobLib implementations
as described in PI 1.10 specification.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
PR #12829 added an early return when LocateHandleBuffer() failed
during short-form hard drive device path expansion. On a fast boot,
a miss in the HDDP cache can occur before Block I/O handles are
available, so the return bypassed EfiBootManagerConnectAll() and
prevented the fallback search from finding the device.
Continue with an empty handle list after the lookup failure. This lets
the existing path connect all controllers and retry the Block I/O search.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
|
|
ArmCcaLib provides helper functions for detecting Realm execution state
and caching Realm IPA width. These helpers build on the architectural Arm
CCA RSI library and are not specific to ArmVirtPkg.
Therefore, move ArmCcaLib, ArmCcaLibNull, their public header, and related
GUID declarations to MdeModulePkg. Update ArmVirtPkg library mappings and
consumers to use the new MdeModulePkg library instances.
Also perform minor non-functional cleanup to the moved INF files by
fixing a comment typo and ordering the package dependencies.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
|
|
The Arm Confidential Compute AArchitecture (CCA) Realm Service
Interface (RSI) is a standard interface that an Arm CCA Realm
Guest VM can utilise to request services from the Arm CCA Realm
Management Monitor (RMM).
The Arm CCA Realm Service Interface is architectural Realm guest
functionality rather than ArmVirt platform-specific code.
Therefore, move ArmCcaRsiLib and its public header to MdeModulePkg,
declare the library class there, and update ArmVirtPkg consumers
to use the new library instance path.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
|
|
QuestionName is allocated by HiiGetString() but is not released in
several code path. This causes memory leaks whenever these paths are
taken.
Add FreePool (QuestionName) after it is no longer needed.
No functional change intended.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
|
|
EFIAPI is required on library interface functions to ensure that the
correct calling convention is used.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
Update the prompt strings for save/exit and confirm actions to show both
uppercase and lowercase key options (e.g., 'Y(y)' and 'N(n)') to make it
clear that the system accepts either case. This improves user experience
by avoiding confusion about case sensitivity.
Affected strings:
- ARE_YOU_SURE (CustomizedDisplayLib)
- CONFIRM_OPTION (DisplayEngineDxe)
- RECONNECT_CHANGES_OPTIONS (DisplayEngineDxe)
French translations are updated accordingly.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
|
|
Previously EfiBootManagerBoot reported
EFI_SW_DXE_BS_EC_BOOT_OPTION_FAILED when a boot option returned an
error, but reported nothing on success. Report the PI 1.10 status
code EFI_SW_DXE_BS_PC_BOOT_OPTION_COMPLETE when a boot option loads,
executes, and returns success, so status code listeners can tell that
a boot option was attempted and that control returned to firmware.
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
|
|
In GetFilename(), the post-loop fallback termination used
sizeof (EfiFileName), which is the size of the CHAR8 * pointer
parameter (8 bytes on X64), not the buffer size. Use EfiFileNameSize -
4 to match the bound of the copy loop above so the string is
terminated at the true end of the buffer.
Tested on OvmfPkgIa32X64, DEBUG, GCC: DumpImageRecords() prints all
runtime image names correctly and NUL-terminated, with no ASSERTs.
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
|
|
Set the numeric step to 1 to allow +/- key adjustment.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
|
|
UefiBootManagerLibConstructor() is a constructor function in BmBoot.c
that is missing as the constructor in the INF file.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
|
|
12828 introduced an ASSERT in HiiGetBrowserData() that fires when
InternalHiiBrowserCallback() returns NULL. This is a valid return
value indicating the browser has no data for the requested variable,
and callers already handle this by checking the FALSE return value.
The ASSERT is incorrect because it triggers on a non-error path,
causing a crash when the browser callback legitimately returns no data.
Remove the unnecessary ASSERT while keeping the existing FALSE return
so callers continue to handle this case gracefully.
Cc: Qihang Gao <gaoqihang@loongson.cn>
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://github.com/github/codeql/blob/codeql-cli-2.7.3/csharp/ql/src/API%20Abuse/UncheckedReturnValue.qhelp
When a function has a return status, it should
be checked to verify the function completed successfully.
Failing to check the return status can result in null pointer
dereferences or use of uninitialized variables.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://github.com/github/codeql/blob/codeql-cli-2.7.3/cpp/ql/src/Critical/MissingNullTest.qhelp
For items which allocate memory, or get a pointer from another
structure, it is important to validate that the pointers
are not null before they are dereferenced.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://codeql.github.com/codeql-query-help/cpp/cpp-comparison-with-wider-type
If the narrow type (smaller range) is compared against a wide type
(larger range), the narrow value may overflow before reaching the wide
value. This can cause unexpected behavior, such as:
Infinite loops (loop condition never becomes false).
Incorrect logic (comparison results are misleading).
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://github.com/github/codeql/blob/codeql-cli-2.7.3/cpp/ql/src/Security/CWE/CWE-457/ConditionallyUninitializedVariable.qhelp
Some local variables, when going through a code path, can
end up uninitialized (using the value they had at the start
of the function). This is generally due to an error path
that can occur based on the library instances, or the
unchecked error (i.e. a allocation failing).
These variables should be initialized with a known value
that will result in the function being able to exit
gracefully.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://github.com/github/codeql/blob/codeql-cli-2.7.3/cpp/ql/src/Critical/MissingNullTest.qhelp
For items which allocate memory, or get a pointer from another
structure, it is important to validate that the pointers
are not null before they are dereferenced.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://github.com/github/codeql/blob/codeql-cli-2.7.3/cpp/ql/src/Security/CWE/CWE-190/ComparisonWithWiderType.qhelp
Switch to using SafeUint16Add for calculating offsets into
block data. The data being used in the calculation comes from
config block strings, and there is no validation of the values
before the calculation occurs.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://github.com/github/codeql/blob/codeql-cli-2.7.3/cpp/ql/src/Critical/MissingNullTest.qhelp
For items which allocate memory, or get a pointer from another
structure, it is important to validate that the pointers
are not null before they are dereferenced.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://codeql.github.com/codeql-query-help/cpp/cpp-comparison-with-wider-type
If the narrow type (smaller range) is compared against a wide type
(larger range), the narrow value may overflow before reaching the wide
value. This can cause unexpected behavior, such as:
Infinite loops (loop condition never becomes false).
Incorrect logic (comparison results are misleading).
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://github.com/github/codeql/blob/codeql-cli-2.7.3/cpp/ql/src/Critical/MissingNullTest.qhelp
For items which allocate memory, or get a pointer from another
structure, it is important to validate that the pointers
are not null before they are dereferenced.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
https://codeql.github.com/codeql-query-help/cpp/cpp-comparison-with-wider-type
If the narrow type (smaller range) is compared against a wide type
(larger range), the narrow value may overflow before reaching the wide
value. This can cause unexpected behavior, such as:
Infinite loops (loop condition never becomes false).
Incorrect logic (comparison results are misleading).
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
|
|
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>
|
|
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 <richard.lyu@suse.com>
|
|
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>
|
|
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 <richard.lyu@suse.com>
|
|
The direct message arguments stripped off the header, making the
underlying FF-A function interface to lose information when it comes to
certain return code, i.e. FFA_YIELD and FFA_INTERRUPT.
This change adds back the header field for this purpose so that the
callers can decide how to act on the corresponding return codes.
It then populates the header field for this purpose in FFA direct
message functions so that the callers can decide how to act on the
corresponding return codes.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
|
|
Replace manual page-size multiplication with EFI_PAGES_TO_SIZE
in the ArmFfaLib sources.
This commit mimics 3457388 and is generated by the following coccinelle
scipt:
```smpl
@pages_to_size@
expression PAGE_COUNT;
@@
- PcdGet64 (PAGE_COUNT) * EFI_PAGE_SIZE
+ EFI_PAGES_TO_SIZE (PcdGet64 (PAGE_COUNT))
```
Tested:
- stuart_ci_build -c .pytool/CISettings.py -p MdeModulePkg -a AARCH64 -t DEBUG TOOL_CHAIN_TAG=GCC
- stuart_ci_build -c .pytool/CISettings.py -p MdeModulePkg -a AARCH64 -t RELEASE,NO-TARGET TOOL_CHAIN_TAG=GCC
Signed-off-by: Mingjie Shen <shen497@purdue.edu>
|
|
Output parameter CurrentVersion of ArmFfaLibGetVersion() is
not optional parameter. That means it should return error
when CurrentVersion is NULL.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
According to the FFA specification, when FFA_RX_RELEASE or
FFA_RXTX_UNMAP is invoked from UEFI as a non-secure virtual instance,
the w1 register must be zero (MBZ). Supplying a non-zero value causes the
SPMC to return FFA_INVALID_PARAMETER.
When these interfaces are invoked from UEFI as a non-secure physical
instance, FFA_ID_GET always returns a VM ID of zero. Therefore,
providing a non-zero VM ID in this context is unnecessary and may be
invalid.
Update ArmFfaLib to always set w1 (VM ID / partition ID) to zero when
invoking FFA_RX_RELEASE and FFA_RXTX_UNMAP, ensuring compliance with
the FFA specification.
Signed-off-by: Shenghu Liu <shenghul@qti.qualcomm.com>
|
|
All debug prints should end in a newline character.
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
|
|
When multiple DXE drivers link DxeCapsuleLib, each driver's constructor
calls InitCapsuleVariable() which attempts to lock capsule-related
variables. The second instance fails with EFI_ALREADY_STARTED because
the policy is already registered, triggering a false ASSERT.
EFI_ALREADY_STARTED from RegisterBasicVariablePolicy means the variable
is already locked, which is the desired state. Treat it as success.
Signed-off-by: default avatarAnandh krishna U <anandhkrishnau@ami.com>
|
|
In PciSioSerialDxe driver, gEfiDevicePathProtocolGuid appears twice in
[Procotols] section. In PiSmmCore driver, gEfiSmmSxDispatch2ProtocolGuid
appears twice in [Procotols] section. In PiSmmIpl driver,
gEfiEventReadyToBootGuid appears twice in [Procotols] section. In
DxeCapsuleLib driver, gEfiCapsuleVendorGuid appears twice in [Guids]
section. The duplicate ones should be removed.
Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
|
|
Current ArmFfaLibGetVersion()'s arguments receive two arguments
-- major version and minor version.
However, This gives some impression treating major and minor version
of the ABI as two unrelated 16-bit variables as opposed to
the upper and lower 16-bits of a 32-bit version variable.
Therefore, change the arguments with whole version and
let user to get major/minor version via ARM_FFA_MAJOR/MINOR_VERSION_GET
macros.
Also, add some useful helper to check version compatibility and
mimimum require ABI version.
Continuous-integration-options: PatchCheck.ignore-multi-package
Suggested-by: Leif Lindholm <quic_llindhol@quicinc.com>
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
This patch adds ArmFfaConsoleDebugLib. A debug library that utilizes
FF-A Console Log API to print debug messages to the console.
This is useful in context of running the StandaloneMm payload
as a S-EL0 SP on top of SPMC where StandaloneMm isn't allowed to
access console device or no console device (e.x) Hafnium.
NOTE:
FFA_CONSOLE_LOG* could be used by secure partition only.
Signed-off-by: Mohamed Gamal Morsy <mohamed.morsy@arm.com>
|
|
There is no mapping ARM_FFA_RET_RETRY with EFI_STATUS but
it falls to EFI_UNSUPPORTED.
Map ARM_FFA_RET_RETRY with EFI_TIMEOUT so that don't make it fall to
EFI_UNSUPPORTED.
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
commit aa02571 ("MdeModulePkg: Change EndofDxeEvent TPLs to TPL_CALLBACK")
changed EndOfDxeEvent TPLs from TPL_NOFIY to TPL_CALLBACK.
However this commit makes a boot failure on the FVP platform when FPDT
ACPI table generation is enabled:
[FirmwarePerformanceDxe] Error when lock variable FirmwarePerformance, Status = Write Protected
ASSERT_EFI_ERROR (Status = Write Protected)
ASSERT [FirmwarePerformanceDxe] FirmwarePerformanceDxe.c(405): !(((RETURN_STATUS)(Status)) >= 0x8000000000000000ULL)
Currently, EVT_NOTIFY_SIGNAL events are managed in FILO order,
as new events are inserted using InsertHeadList().
The sequence is as follows:
1. DxeCore initializes DxeCorePerformanceLib, whose constructor creates
an EndOfDxe event (gEfiEndOfDxeEventGroupGuid) with the
ReportFpdtRecordBuffer() callback.
2. MmCommunicationDxe (in ArmPkg) creates another EndOfDxe event to
notify StandaloneMm. This event is inserted ahead of the one created
in (1).
3. PlatformBootManagerBeforeConsole() signals EndOfDxe, which triggers
the event created in (2) first.
4. When the callback from (2) runs, StandaloneMm calls
LockVariablePolicy().
5. The callback from (1) is then invoked and attempts to update FPDT via
InstallFirmwarePerformanceDataTable(). During this process, it tries
to register a variable policy for the FirmwarePerformance variable.
However, since the Variable Policy interface was locked in (4), the
operation fails with EFI_WRITE_PROTECTED.
To resolve this issue, revert EndofDxeEvent TPLs to TPL_NOTIFY for FPDT.
Fixes: aa02571 ("MdeModulePkg: Change EndofDxeEvent TPLs to TPL_CALLBACK")
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
|
|
Change FPDT events at EndOfDxe to TPL_CALLBACK as TPL_NOTIFY is not
necessary.
Signed-off-by: Sherry Fan <sherryfan@microsoft.com>
|
|
Updates BmBoot and dispatcher to use new perf macros.
Signed-off-by: Sherry Fan <sherryfan@microsoft.com>
|
|
Required by implementation of ArmFfaLibYield.
Fixes: 6479778e6b3890f65580bfbd50426046533b85a8
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
|
|
Add the FF-A YIELD command to the FF-A library.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Raymond Diaz <raymonddiaz@microsoft.com>
|
|
Fix markdownlint formatting issues in READMEs.
Signed-off-by: Sherry Fan <sherryfan@microsoft.com>
|