Commit Graph

33776 Commits

Author SHA1 Message Date
Ceping Sun 3b07a2fb52 SecurityPkg/Ppi: Add gEdkiiCcPpi for CC Measurement in PEI phase
gEdkiiCcPpi is designed to support CC measurement in PEI phase.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2024-12-10 02:09:29 +00:00
John Chung 481c43308b MdePkg: Add new PCDs for IPMI Serial
This change adds new PCDs for IPMI Serial.

Specification reference:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: John Chung <john.chung@arm.com>
2024-12-09 19:57:53 +00:00
John Chung 5b760ca087 MdePkg/IndustryStandard: Add definitions for IPMI Serial
Add IPMI Serial definitions

Specification reference:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: John Chung <john.chung@arm.com>
2024-12-09 19:57:53 +00:00
Pierre Gondois e53cf2412a ShellPkg/UefiShellLevel2CommandsLib: Add helper for reset -fwui option
Following the UEFI Shell Specification revision 2.2,
add helper for the '-fwui' option of the reset command.

Signed-off-by: Pierre Gondois <Pierre.Gondois@arm.com>
2024-12-09 17:16:58 +00:00
Ajan Zhong 694cc9f100 UefiPayloadPkg: Update ReadUnaligned64 in ACPI parsing
According to ACPI Specification, 64 bit physical address of the XSDT
provides indentical functionality to the RSDT but accommodates physical
address of description headers that are larger than 32 bits.

In this case physical address of XSDT table is 64 bit aligned, however
size of ACPI description tabled header is not 64 bit aligned. It leads
to the entry of other description headers are not 64 bit aligned. In
AARCH64 architecture, deference non-aligned 64 bit address to fetch
64-bit data will trigger Alignment fault. Use ReadUnaligned64 method
to fix this unaligned data access issue.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2024-12-09 02:23:28 +00:00
Ajan Zhong ddb4ea681b UefiPayloadPkg: Update FDT parser logic for unaligned data access
If alignment check is enabled in AARCH64 platform, FDT parser might
dereference non-aligned 64-bit address to fetch 64-bit data.
Use unaligned data read to avoid triggering unaligned data access.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2024-12-09 02:23:28 +00:00
Ajan Zhong 2d6d03056a UefiPayloadPkg: Add AARCH64 support on FdtParserLib
Add AARCH64 support on FdtParserLib.

Signed-off-by: Ajan Zhong <ajan.zhong@newfw.com>
2024-12-09 02:23:28 +00:00
Gerd Hoffmann f0424ec80e OvmfPkg: disable iscsi by default
While IScsiDxe certainly is a useful feature it is rarely used, and it
slows down firmware boot quite a bit.  So disable it by default and only
load it in case this is explicitly requested via fw_cfg.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann 645988d9b3 OvmfPkg: add PcdEntryPointOverrideDefaultValue
UefiDriverEntryPointFwCfgOverrideLib will use
PcdEntryPointOverrideDefaultValue to decide what to do in case the
fw_cfg file specified via PcdEntryPointOverrideFwCfgVarName is not
present.  Default is "yes".

This allows to disable drivers by default and only enable them when
requested via fw_cfg.

Also log a message with the config option applied and whenever the
default value or a fw_cfg option was used.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann 9ca29831f6 OvmfPkg: add fw_cfg option for usb storage
Use UefiDriverEntryPointFwCfgOverrideLib for UsbMassStorageDxe so
the driver can be enabled/disabled via fw_cfg option.

usage: qemu -fw_cfg name=opt/org.tianocore/UsbStorageSupport,string={yes,no}

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann f9335bcb7c OvmfPkg: add fw_cfg option for iscsi support
Use UefiDriverEntryPointFwCfgOverrideLib for IScsiDxe so the driver
can be enabled/disabled via fw_cfg option.

usage: qemu -fw_cfg name=opt/org.tianocore/ISCSISupport,string={yes,no}

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann b9cb18206a OvmfPkg: add fw_cfg option for virtio-net support
Use UefiDriverEntryPointFwCfgOverrideLib for VirtioNetDxe so the driver
can be enabled/disabled via fw_cfg option.

usage: qemu -fw_cfg name=opt/org.tianocore/VirtioNetSupport,string={yes,no}

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann 5be587067a OvmfPkg: move USB drivers to new UsbComponents.dsc.inc
Allows to update USB driver configuration without
touching all *.dsc files.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Gerd Hoffmann b3b3cfab7e OvmfPkg: move VirtioNet to NetworkComponents.dsc.inc
Allows to update VirtioNet driver configuration without
touching all *.dsc files.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 20:45:29 +00:00
Alexander Gryanko 35706d43c5 NetworkPkg: PXE boot option build flag
Currently, the only way to disable PXE boot options is to change the PCD
variables PcdIPv4PXESupport and PcdIPv6PXESupport in the source code or
use the "--pcd" option in the build script. Other boot options such
as HTTP or iSCSI can be disabled using the -D<option> flag.
NETWORK_PXE_BOOT_ENABLE will add a consistent way to disable PXE booting.
This is the third and final part of a series of patches to enable the
NETWORK_PXE_BOOT_ENABLE build flag. At this point, the flag will be able
to disable PXE functionality.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2024-12-06 18:26:01 +00:00
Alexander Gryanko 087a47688c OvmfPkg: PXE boot option build flag
The second step is to add an option to the OvmfPkg module to disable
PXE booting using the NETWORK_PXE_BOOT_ENABLE flag. The patch is divided
into 3 parts. At the current stage the flag is not functional.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2024-12-06 18:26:01 +00:00
Alexander Gryanko 9e0c46efb0 ArmVirtPkg: PXE boot option build flag
The first step is to add an option to disable PXE loading. The patch is
divided into 3 parts. This part adds the NETWORK_PXE_BOOT_ENABLE flag
to the ArmVirtPkg module. At the current stage the flag is not functional.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2024-12-06 18:26:01 +00:00
Mike Maslenkin f6422011e5 MdeModulePkg/PlatformDriOverrideDxe: fix HiiOpCodeHandle leak
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2024-12-06 17:13:17 +00:00
Mike Maslenkin 1b283cf437 MdeModulePkg/UiApp: fix HiiOpCodeHandle leak
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2024-12-06 17:13:17 +00:00
Mike Maslenkin e8cfc7beba NetworkPkg/IScsiDxe: fix HiiOpCodeHandle leak
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2024-12-06 17:13:17 +00:00
Mike Maslenkin b1cdfc556f SecurityPkg/OpalPassword: fix HiiOpCodeHandle leak on error path
Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2024-12-06 17:13:17 +00:00
Doug Cook (WINDOWS) fd9501f582 DxeRngLib: GetRandomNumber spurious success
The GetRandomNumber functions in DxeRngLib can return success without
actually generating a random number. This occurs because there are code
paths through `GenerateRandomNumberViaNist800Algorithm` that do not
initialize the `Status` variable.

- Assume mFirstAlgo == MAX_UINTN (no secure algorithms available)
- Assume none of the secure algorithms have `Available` set.
- Assume PcdEnforceSecureRngAlgorithms is TRUE.

In this condition, the `Status` variable is never initialized, `Buffer`
data is never touched. It is fairly likely that Status is 0, so we can
return EFI_SUCCESS without writing anything to Buffer.

Fix is to set `Status = error_code` in this code path.
`EFI_SECURITY_VIOLATION` seems appropriate.

Signed-off-by: Doug Cook <idigdoug@gmail.com>
2024-12-06 15:55:55 +00:00
Doug Cook (WINDOWS) bbcdc0b7d9 MdePkg: Improve comments on DebugLib PCDs
DebugLib PCDs are very important, but they're confusing and not
well-explained anywhere. Improve the documentation comments for them to
explain how they work and how they relate to each other.

Signed-off-by: Doug Cook <idigdoug@gmail.com>
2024-12-06 14:34:18 +00:00
Rebecca Cran 5b2d55533b BaseTools: Improve error messages from UefiCapsuleHeader.py
Instead of throwing ValueErrors with no explanation, add a message
explaining what went wrong.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-06 13:02:18 +00:00
Phil Noh e508c6c08a MdeModulePkg/DxeIplPeim: Free scratch buffer after FV extraction
The scratch buffer (EfiBootServicesData) is assigned to extract DXE FVs
that are compressed. The matching decompression library returns the buffer
size as below. The buffer is no longer used after completing extraction.
Need to free the buffer to optimize memory allocation and usage.

BaseUefiDecompressLib : sizeof (SCRATCH_DATA)
LzmaCustomDecompressLib : SCRATCH_BUFFER_REQUEST_SIZE (64KB)
BrotliCustomDecompressLib : From EncodeData header (usually, xxMB checked)

In case of Brotli decompression, it is found that a big chunk of memory is
required, based on EncodeData header. (e.g. a 4MB compressed FV reports
about 39MB scratch size)

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2024-12-06 10:17:16 +00:00
Gerd Hoffmann 73570d8ab6 openssl: disable visual studio warning #4189
4189 is "local variable is initialized but not referenced"

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 99e18f2327 CryptoPkg: CI: update OpensslGen file list
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 8c5dcecd24 CryptoPkg: gcc needs 4k section alignment too
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 9895fe25ac CryptoPkg/BaseCryptLib: add next parameter to SHA3_squeeze
Needed for openssl 3.3.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann a801363249 CryptoPkg: add openssl/providers/fips/include to includes
Needed for openssl 3.4.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 005f4c6b5e openssl: add more stubs for openssl 3.2.x
openssl-3.2.2 got a few more tls config hooks, add stubs for them.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 53cea8efd1 openssl: adapt stubs to openssl 3.2.x
Function declarations have changed in openssl-3.2.x, adapt the stubs.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann 8f6c2ccc45 openssl: update generated files
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Gerd Hoffmann e584e865f8 openssl: update submodule to 3.4.0
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-06 08:01:25 +00:00
Aniket_Surekar 333e9638ad MdeModulePkg/Bus/Pci: Fix Descriptor Misalignment in USB Config Handling
The issue with locating the expected interface and endpoint descriptors
arises because `configDesc` (USB_CONFIG_DESCRIPTOR) and `IfDesc`
(USB_INTERFACE_DESCRIPTOR) are incremented by structure size rather than
by actual descriptor length.

Specifically:
  - `configDesc` should be incremented by its actual length.
  - `IfDesc` should be incremented by its actual length.

This incorrect increment causes misalignment, preventing access to the
subsequent interface and endpoint descriptors.

[Suggested Solution]
Update the code to increment the pointers by the actual descriptor lengths,
ensuring proper access to all descriptors in the USB configuration.

Signed-off-by: Aniket Surekar <Aniket.Surekar@Dell.com>
2024-12-06 01:45:22 +00:00
Ard Biesheuvel e8668d2dee MdeModulePkg/DxeCore: Call BeforeExitBootServices event group only once
According to UEFI spec 2.10 errata A section 7.4.6

  "All events from the EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES and
  EFI_EVENT_GROUP_EXIT_BOOT_SERVICES event notification groups as well
  as events of type EVT_SIGNAL_EXIT_BOOT_SERVICES must be signaled
  before ExitBootServices() returns EFI_SUCCESS. The events are only
  signaled once even if ExitBootServices() is called multiple times."

So keep track of whether ExitBootServices() has been called, and signal
the event group EFI_EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES only the first
time around.

EFI_EVENT_GROUP_EXIT_BOOT_SERVICES will only be signalled if
ExitBootServices() is going to run to [successful] completion, after
which calling it a second time is not possible anyway. So for this case,
no special handling is needed.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-12-06 08:33:53 +08:00
Ard Biesheuvel 47e28a6d44 ArmVirtPkg/ArmPlatformLibQemu: Enable early ID map on EL2+VHE
When booting at EL2, enable VHE if available so that the early ID map
can be enabled as well. This gets rid of any memory accesses (reads or
writes) before the MMU and caches are enabled.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-12-05 10:50:48 +00:00
Chao Li 793f4d2662 Maintainers.txt: Add a new R for LoongArch64
Added Xiangdong Meng as a new reviewer for LoongArch64 ARCH.

Signed-off-by: Chao Li <lichao@loongson.cn>
2024-12-05 03:10:43 +00:00
Oliver Steffen 47ef197873 BaseTools: Coverage: Detect lcov version
Detect the version of lcov and only apply
version 2 workaround when needed.

Fixes 61c714285f

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-12-05 00:05:47 +00:00
Gerd Hoffmann 2940708eb2 NetworkPkg/DxeNetLib: drop GLOBAL_REMOVE_IF_UNREFERENCED
With mSecureHashAlgorithms being static this should not be
needed any more.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-04 22:25:37 +00:00
Gerd Hoffmann d31fd8bcb7 MdePkg/DxeRngLib: drop GLOBAL_REMOVE_IF_UNREFERENCED
With mSecureHashAlgorithms being static this should not be
needed any more.

Suggested-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-04 22:25:37 +00:00
Rebecca Cran 061bccff3a DynamicTablesPkg: Update link to iASL in Readme.md
Links from acpica.org are now redirected to the ACPICA overview page
on intel.com. Update the link so it goes to the 20200717 download page.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-04 20:37:33 +00:00
Ray Ni 210a76e917 Remove Ray from maintainer list of FatPkg
Signed-off-by: Ray Ni <ray.ni@intel.com>
2024-12-04 17:22:22 +00:00
Gerd Hoffmann 775d6cd7ed OvmfPkg/QemuFwCfgDxeLib: use PcdConfidentialComputingGuestAttr
Check PcdConfidentialComputingGuestAttr instead of calling
MemEncryptSevIsEnabled() and MemEncryptTdxIsEnabled() to figure
whenever SEV or TDX is enabled.

This allows to remove the MemEncryptSevLib + MemEncryptTdxLib
dependencies.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2024-12-04 12:40:35 +00:00
Rebecca Cran 194cdc1700 SecurityPkg: remove unused `EfiSig` variable in SecureBootFetchData
The `EfiSig` variable in SecureBootFetchData is unused, so remove it.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-04 11:05:10 +00:00
Rebecca Cran dfab971e91 SecurityPkg: Improve formatting of msg when GetVariable fails
Improve the formatting of the error message when GetVariable
fails: start the message with an upper-case character, and close the
quotes around the variable name.

Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-12-04 09:30:53 +00:00
Oliver Steffen 61c714285f BaseTools: Coverage: make lcov v2.0 work
lcov 2.0 and newer does additional error and consistency checking
compared to previous versions. This can lead to CI jobs failing due to
new/unexpected errors showing up.

See:
- https://edk2.groups.io/g/devel/message/116138
- https://github.com/linux-test-project/lcov/issues/209
- https://github.com/linux-test-project/lcov/issues/238

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-12-04 06:08:05 +00:00
Oliver Steffen 29859cbc28 CI: Use latest Fedora 40 image for Linux jobs
The Fedora 40 images uses gcc 14, includes libasan and
libubsan, clang, and some fixes and improvements.

See c98ff99762

Signed-off-by: Oliver Steffen <osteffen@redhat.com>
2024-12-04 06:08:05 +00:00
Oliver Smith-Denny 0f9dbb4abf Maintainers.txt: Add myself as FatPkg Maintainer
Per request from current FatPkg maintainer Ray Ni, I am
signing up to maintain FatPkg.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2024-12-04 02:58:55 +00:00
Jeff Brasen 745cab5aad DynamicTablesPkg: Fix BDF format for PCI initiators
The BDF format for PCI initiators in the SRAT table is incorrect.
The format is not a UINT16 but specific bytes.

PCI Bus Number (Bits 7:0 of Byte 2)
PCI Device Number (Bits 7:3 of Byte 3)
PCI Function Number (Bits 2:0 of Byte 3)

REF: https://uefi.org/specs/ACPI/6.5/05_ACPI_Software_Programming_Model.html#device-handle-pci
Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
2024-12-03 22:13:29 +00:00