Commit graph

36559 commits

Author SHA1 Message Date
VarshitPandya
2c82d4ada9 DynamicTablesPkg: Add SMBIOS Voltage Probe (Type 26) generator
Add a Configuration Manager object and parser for SMBIOS Type 26
Voltage Probe information.

Add a Type 26 SMBIOS generator that creates one Voltage Probe
structure for each Voltage Probe CM object. The generator validates
the probe location and status fields, publishes the optional
description string, and registers the generated table with the
SMBIOS table factory.

Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-07-02 09:10:11 +00:00
VarshitPandya
c362e91e56 ShellPkg: Add missing smbiosview Type 28 locations
Add the missing SMBIOS Type 28 Temperature Probe location decode values
to smbiosview.

The Type 28 Location field defines values 0x0C through 0x0F for Front
Panel Board, Back Panel Board, Power System Board, and Drive Back Plane,
but smbiosview only decoded values up to 0x0B.

Signed-off-by: VarshitPandya <varshit.pandya@arm.com>
2026-07-02 07:22:54 +00:00
VarshitPandya
7bc6629f40 ShellPkg: Fix smbiosview Type 26 location/status decode
The smbiosview Type 26 Voltage Probe decoder uses the low 5 bits of
LocationAndStatus as the probe location and the high 3 bits as the probe
status.

However, the Type 26 lookup tables were swapped: VPLocationTable contained
status strings and VPStatusTable contained location strings. This caused
valid records to be displayed as, for example:

  Voltage Probe - Location: OK
  Voltage Probe - Status: Processor

Swap the table contents so Type 26 output matches the SMBIOS
LocationAndStatus bit layout.

Signed-off-by: VarshitPandya <varshit.pandya@arm.com>
2026-07-02 07:22:54 +00:00
Qihang Gao
8dab052c57 ShellPkg: Add null pointer checks before dereference
In AllocateMemory(), several pointers are used without prior null
checks. This may lead to unexpected behavior or system crashes if any
of these pointers are NULL.

Add explicit null checks for these pointers to ensure safe access and
prevent potential null pointer dereferences.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-07-01 12:10:28 +00:00
Michael Kubacki
ae6bf21c82 .mergify/config.yml: Set update_method to merge
Originally, edk2 sought to have mergify use rebases to update PR
branches. However, mergify is deprecating pull requests from forks
with update_method=rebase and update_bot_account impersonation:

  Deprecation notice: This pull request comes from a fork and was
  queued with update_method=rebase and update_bot_account
  impersonation. This capability will be removed on July 1, 2026.
  After this date, the merge queue will no longer be able to rebase
  fork pull requests with this configuration. To avoid disruption,
  switch to update_method=merge in configuration. To avoid disruption,
  switch to update_method=merge in your queue rule.

This change explicitly sets the update_method to merge per the
deprecation guidance.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-07-01 02:52:29 +00:00
Michael G.A. Holland
7bd23c60e8 CryptoPkg/BaseCryptLib: Add ED448 verification and signature fcns
Implemented signature and verification functions for ED448;
  Updated documentation and unit tests to cover new verification functions

Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
2026-07-01 01:26:24 +00:00
Michael Kubacki
48a82ffcbd BaseTools: Remove VS2017 support
Removes Visual Studio 2017 support from BaseTools. Newer toolchains
(VS2019, VS2022, and VS2026) are supported in its place.

This removes the VS2017 toolchain definitions from tools_def.template,
the VS2017 environment setup logic in toolsetup.bat,
set_vsprefix_envs.bat, and get_vsvars.bat, and the VS2017
configuration in the WindowsVsToolChain build plugin.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
3dc01cce24 DynamicTablesPkg: Retarget VS2017 static analysis build option
VS2017 support is being removed from edk2. The static analysis
(/analyze) build option that suppressed C6305 was scoped to the VS2017
toolchain. This change retargets it to VS2019, which is the oldest
Visual Studio toolchain that remains supported.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
84012d29f7 EmulatorPkg: Remove VS2017 Visual Studio solution
VS2017 support is being removed from edk2. This Visual Studio solution
built the EmulatorPkg host with the VS2017 toolchain (`-t VS2017`),
which will no longer exist in tools_def.template. The EmulatorPkg
documentation and CI build with VS2022, so the VS2017 solution is
removed.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
b7d780bf13 edksetup.bat: Remove VS2017 support
The VS2017 toolchain is being removed from edk2. In preparation, this
change removes the toolchain as an option in edksetup.bat.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
12196e96db RedfishPkg: Remove VS2015x86 reference
Visual Studio 2015 is out of service and support was recently removed
from the repo. To prevent confusion about toolchain support, this
commit updates the RedfishPkg Readme to replace the `VS2015x86`
reference with `VS2026` (the latest supported VS version).

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
f22b20e6ae MdePkg: Generalize VS15 warning comment in ProcessorBind.h
The Ia32 and X64 ProcessorBind.h files had comments about VS2015, but
the warning is still relevant for newer VS versions, so update the
comments to be more general since VS2015 support was removed from the
repo recently.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
13df0bd463 CryptoPkg: Remove VS2015 specific compiler flags
VS2015 support is being removed in edk2 as it is out of service.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
4b21e5e902 BaseTools: Remove VS2015 support
REF: https://github.com/tianocore/edk2/issues/12490

Removes Visual Studio 2015 support from BaseTools since mainstream
support ended on October 13, 2020 and extended support ended on
October 14, 2025.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
3a9c8cfc30 edksetup.bat: Remove VS2015 support
The VS2015 toolchain is being removed from edk2. In preparation, this
change removes the toolchain as an option in edksetup.bat.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
edf045a7ae BaseTools: Remove SetVisualStudio.bat
This file has:

- Not been updated in 10 years.
- Was used to build Nt32Pkg which no longer exists.
- Is not needed to currenly build EmulatorPkg.
- Was last updated to support Visual Studio 2015, which is no longer
  supported by Microsoft.

It is removed as part of the Visual Studio 2015 removal.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
Michael Kubacki
b6d3ac52d7 BaseTools: Remove ShowEnvironment.bat
This file:

- Has not had a code change in 8 years.
- Is not used by any other file in the repository.
- Was last updated to support VS2015 which is no longer supported by
  Microsoft.

As part of VS2015 support removal, this file is deleted.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-30 21:42:50 +00:00
VarshitPandya
d7f133a164 DynamicTablesPkg: Link SMBIOS Type 27 to Type 28 probes
Use the TemperatureProbeToken in the Cooling Device CM object to resolve
the SMBIOS handle of the corresponding Type 28 Temperature Probe record.

Set the Type 27 TemperatureProbeHandle field to 0xFFFF when no
temperature probe token is provided. Return an error if a non-null token
does not resolve to a generated Type 28 record.

Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-06-30 20:31:10 +00:00
VarshitPandya
5628eaaf38 DynamicTablesPkg: Add SMBIOS Temperature Probe (Type 28) generator
Introduce a CM_ARCH_COMMON_TEMPERATURE_PROBE_INFO object to describe
temperature probes provided by the platform. The generator creates one
SMBIOS Type 28 record for each temperature probe object and populates
the description, location/status, probe limits, resolution, tolerance,
accuracy, OEM-defined data, and nominal value.

Add the CM object parser entry and wire the generator into the
DynamicTablesPkg build.

Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-06-30 20:31:10 +00:00
VarshitPandya
0c2e337351 DynamicTablesPkg: Add SMBIOS Cooling Device (Type 27) generator
Introduce a CM_ARCH_COMMON_COOLING_DEVICE_INFO object to describe
cooling devices provided by the platform. The generator creates one
SMBIOS Type 27 record for each cooling device object and populates the
device type/status, cooling unit group, OEM-defined data, nominal speed,
and optional description string.

The temperature probe handle is set to 0xFFFF for now because SMBIOS
Type 28 Temperature Probe generation is not currently available. Reject
non-null temperature probe tokens until Type 28 handle resolution can be
added.

Add the CM object parser entry and wire the generator into the
DynamicTablesPkg build.

Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-06-30 20:31:10 +00:00
Oliver Smith-Denny
f26ba713c6 Maintainers.txt: Add Myself as MdeModulePkg/Core Maintainer
Add myself as a maintainer of DXE and PEI Core modules.

As I am taking on a larger maintenance set, drop my EmulatorPkg
maintainership to focus on the new one.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-06-30 19:27:21 +00:00
Jared Pan
9a65be14eb NetworkPkg/SnpDxe: Fix MAC address passthrough support
During SnpUndi32Initialize(), CurrentAddress is unconditionally
overwritten with PermanentAddress before UNDI initialization. This
causes MAC address passthrough (MacPassthru) to fail, as the NIC's
actual current address, which may differ from its permanent address,
is lost.

After UNDI initialization completes, call PxeGetStnAddr() to read
the NIC's station address via the UNDI interface and update
CurrentAddress, PermanentAddress, and BroadcastAddress in the mode
structure with the values reported by the hardware.

The call is added to both initialization paths: the cable-detect
success path and the fallback no-cable-detect path.

Signed-off-by: Jared Pan <jared.pan@dell.com>
2026-06-30 17:27:16 +00:00
Syed Mohammed Nayyar
24788b6190 NetworkPkg/IScsiDxe: bound value length in IScsiBuildKeyValueList
IScsiBuildKeyValueList parses the data segment of a received iSCSI
login, text or CHAP response into key=value pairs. After locating '='
within the remaining length, it sets KeyValuePair->Value and calls
AsciiStrLen(Value) to measure the value before subtracting it from the
remaining length. AsciiStrLen has no length cap, and the data segment
copied from the received PDU (AllocatePool(Len) + NetbufQueCopy of the
data-segment length) is not guaranteed to be NUL-terminated.

A malicious or redirecting target can send a data segment whose final
value lacks a trailing NUL (e.g. the 3 bytes "X=Y"), so AsciiStrLen
reads past the end of the segment allocation, an attacker-controlled
out-of-bounds read. The SafeUint32Sub bound check only runs after the
over-read.

Replace AsciiStrLen(Value) with AsciiStrnLenS(Value, Len), capping the
scan to the bytes remaining from Value onward. An unterminated value
then returns Len and the existing SafeUint32Sub rejects the segment.
The single change covers all three callers (login redirect, operational
parameter negotiation and CHAP).

Signed-off-by: Syed Mohammed Nayyar <jmestwa@gmail.com>
2026-06-30 16:34:46 +00:00
Jared Pan
8c0dea946f MdeModulePkg/UsbBusDxe: Manufacturer String Descriptor Caching
Certain devices require immediate follow-up commands
after reading the LANGID string to fetch Manufacturer,
Product, or SerialNumber strings.

[Suggested Solution]
These strings are now cached after initial retrieval
to allow UsbIoGetStringDescriptor() to return them
directly, improving efficiency and stability.

Signed-off-by: Marlboro Chuang <marlboro.chuang@dell.com>
Signed-off-by: Jared Pan <jared.pan@dell.com>
2026-06-30 11:47:34 +00:00
Jared Pan
23ebccb46c MdeModulePkg/UsbBusDxe: Improve USB enumerating process
The patch enhances the USB enumeration process in EDK2 to improve compatibility with non-standards-compliant devices that may fail during standard enumeration sequences.
The suggested solution is based on USB specifications and references implementations from both Linux and Windows environments.

[Suggested solution]
- Integrated a retry mechanism to sequentially execute enumeration scripts, inspired by the enumeration flows of Windows, Linux, and EDK2. This improves robustness when handling corner-case devices.
- Do sanity check while the device report the device descriptor.
- AMD XHCI might need to wait for more time while sending the CLEAR_FEATURE reuqest.

Signed-off-by: Marlboro Chuang <marlboro.chuang@dell.com>
Signed-off-by: Jared Pan <jared.pan@dell.com>
2026-06-30 10:35:12 +00:00
20000419
4f475ba542 SecurityPkg/AuthVariableLib: harden signature list filtering
Signed-off-by: 20000419 <lzy20000419@outlook.com>
2026-06-30 02:35:17 +00:00
VarshitPandya
4ad28a8588 ShellPkg: ShellPkg: Fix SMBIOS Type 28 probe labels
Use a Temperature Probe specific HII string when displaying the Type 28
Location field in smbiosview.

The Type 28 decoder was using the Voltage Probe location label, causing
temperature probe records to be displayed with the wrong field name.

Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-06-29 17:19:33 +00:00
VarshitPandya
39d8052bc6 ShellPkg: Fix SMBIOS Type 26 probe decoding
Decode the Type 26 Voltage Probe Location and Status fields according
to the SMBIOS 3.9.0 specification, section 7.27, "Voltage Probe
(Type 26)".

Table 95, "Voltage Probe: Location and Status fields", defines bits
4:0 as the Location field and bits 7:5 as the Status field. smbiosview
was decoding these fields in the opposite order, causing the displayed
voltage probe location and status to be swapped.

Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-06-29 17:19:33 +00:00
Qihang Gao
97f069bf30 RedfishPkg: Remove unnecessary Depex section in library modules
Libraries that may be consumed by UEFI_DRIVER should not have depex
section for UEFI_DRIVER. The INF specification said: If the Module is
a Library, then a [Depex] section is optional. Regarding HiiUtilityLib,
RedfishDebugLib and RedfishHttpLib, they don't have additional dependence,
so the Depex sections should be removed to ensure no adverse impact on
the UEFI_DRIVER.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-06-29 16:41:24 +00:00
Pierre Gondois
c70de6b4ed DynamicTablesPkg/CmObjParser: Use common interrupt parser
CmArmDmc620PmuRegInfoParser only parses the interrupt field
without parsing the interrupt flags. Fix it.

Also make CmArmCmn600InfoParser use the common interrupt
parser instead of separately printing the interrupt number
and flag.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-06-29 07:45:14 +00:00
Pierre Gondois
3ca262e05c DynamicTablesPkg/CmObjParser: Fix ArmNamespaceObjectParser order
Dmc620 have been added at an incorrect index in the
ArmNamespaceObjectParser array. Fix the order.

Also, rename:
- CmArmObjDmc620PmuSocketInfoParser
to:
- CmArmDmc620PmuSocketInfoParser
to follow the other conventional names.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-06-29 07:45:14 +00:00
Pierre Gondois
1eab31a287 DynamicTablesPkg/CmObjParser: Add missing fields to CmObjParser
The following objects are missing some fields in the
CmObjParser:
- CM_ARCH_COMMON_PROC_HIERARCHY_INFO
- CM_ARCH_COMMON_CACHE_INFO

Add them.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-06-29 07:45:14 +00:00
Pierre Gondois
4ac0ee3fd0 DynamicTablesPkg/SmbiosType4Lib: Fix processor characteristics description
Always set the ProcessorArm64SocId bit for arm64 build
and conditionally set the Processor64BitCapable bits for
64-bits architectures.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-06-29 07:45:14 +00:00
Pierre Gondois
d1806ae8fa DynamicTablesPkg: Clear output parameter before callback invocation
BuildSmbiosTable() and BuildSmbiosTableEx() callback are called
with uninitialized pointers which might contain garbage data. If
one of these function fails, the exit handler uses these
uninitialized fields.

Set these uninitialized pointers in the caller function.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-06-29 07:45:14 +00:00
Jiaqing Zhao
e3e93cf092 MdeModulePkg/PciBusDxe: Fix Mem64 BAR handling in IsPciDeviceRejected()
IsPciDeviceRejected() masks BAR value with 0xFFFFFFF0 before testing
the type bits (2:1) that mark a 64-bit memory BAR, essentially clears
them, making the 64-bit BAR code path unreachable and treated as if
it were 32-bit.

The function rejects a device when BAR looks unprogrammed by comparing
if its size mask equals its value. When a 64-bit BAR is mistaken for a
32-bit one, only its lower part is compared, possibly leading a valid
BAR being falsely rejected. For example, a 2G BAR with size mask
0x80000000 at 0x180000000 matches and the device is dropped.

This code runs during light enumeration (PciEnumeratorLight), used when
PCI resources are already assigned by the platform (e.g. Xen HVM, where
hvmloader programs the BARs). The rejected device never receives a
PciIo handle, so no driver can bind to it. For example, a virtio-vga
with a 64-bit BAR vanishes under OVMF on Xen, leaving the guest with
no graphics output.

Fix by testing the type bits on the raw BAR value before masking.

Signed-off-by: Jiaqing Zhao <Zhao.Jiaqing@amd.com>
2026-06-29 02:25:40 +00:00
Michael Kubacki
35b5565764 BaseTools/Ecc: Add check for traditional include guards
Adds a new ECC check, `IncludeFileCheckPragmaOnce` (error code 6006),
that flags header files using a traditional `#ifndef`/`#define`
include guard and recommends `#pragma once` instead.

A guard is detected when a '#ifndef NAME' is immediately followed by a
valueless '#define NAME' using the same macro name. Feature macros
such as '#define FOO 1' and files already using '#pragma once' are not
flagged.

The check reports against the parsed preprocessor directive rows in
the identifier tables rather than the File table. Those rows carry the
actual source line number, whereas File-level findings resolve to
"line 1" in the report. This gives an accurate line number, to the
EccCheck CI plugin, so it can reconcile findings with the changed line
ranges of a commit.

It uses the binary extension list and the exception list, consistent
with the other include file checks.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-26 02:18:38 +00:00
Michael Kubacki
4b27e8e20b BaseTools: Fix MODEL_IDENTIFIER_MACRO_PROGMA typo
Fixes typo in the constant name.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-26 02:18:38 +00:00
Ashraf Ali S
ddd6cc304e Maintainers.txt: Add Ashraf as maintainer to BaseTools
Signed-off-by: Ashraf Ali S <ashraf.ali.s@intel.com>
2026-06-25 21:10:49 +00:00
Michael Kubacki
fd7a2a5488 SecurityPkg: Update Tpm2Ptp.h to follow pragma once coding convention
Update Tpm2Ptp.h to follow the latest EDK II C Coding Standards
Specification (5.3) to use '#pragma once' instead of traditional
macro-based include guards in header files.

https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/draft/5_source_files/53_include_files.html#53-include-files

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-25 19:40:31 +00:00
Michael Kubacki
fde4a758fd MdePkg: Follow pragma once coding convention
Update recent changes in MdePkg to follow the latest EDK II
C Coding Standards Specification (5.3) to use '#pragma once' instead
of traditional macro-based include guards in header files.

https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/draft/5_source_files/53_include_files.html#53-include-files

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-25 19:40:31 +00:00
Michael Kubacki
16b41f7d02 MdeModulePkg: Follow pragma once coding convention
Update recent changes in MdeModulePkg to follow the latest EDK II
C Coding Standards Specification (5.3) to use '#pragma once' instead
of traditional macro-based include guards in header files.

https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/draft/5_source_files/53_include_files.html#53-include-files

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-25 19:40:31 +00:00
Michael Kubacki
96e2af4cc4 ManageabilityPkg: Follow pragma once coding convention
Update recent changes in ManageabilityPkg to follow the latest EDK II
C Coding Standards Specification (5.3) to use '#pragma once' instead
of traditional macro-based include guards in header files.

https://tianocore-docs.github.io/edk2-CCodingStandardsSpecification/draft/5_source_files/53_include_files.html#53-include-files

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-25 19:40:31 +00:00
Sami Mujawar
8a6cd66acb SecurityPkg/HashInstanceLibSha256: Remove unused Tpm2CommandLib dependency
The HashInstanceLibSha256 library does not call into Tpm2CommandLib.
Removing it from the [LibraryClasses] section reduces unnecessary
dependencies and avoids potential build issues in non-TPM builds.

Also remove the unnecessary include of Tpm2CommandLib.h

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2026-06-25 16:53:36 +00:00
Sami Mujawar
5f389e499c CryptoPkg: Enable SHA256 hash in SecCryptLib
Enable CryptSha256 hash in SecCryptLib as this
is required by Arm CCA.

The hash algorithm used by the Arm CCA Realm
Extensible Measurement (REM) registers is
either SHA256 or SHA512.

To enable measurements in the early boot phase
enable SHA256 hash algorithm in SecCryptLib.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2026-06-25 16:53:36 +00:00
Oliver Smith-Denny
a5fcc0a6ac MdeModulePkg: CxlDxe: Fix IA32 Build Break
CxlDxe is currently compiled as part of the MdeModulePkg
IA32 CI. When running CI with VS2022 version 14.44.35228.0,
the CI build fails with:

CxlDxe.lib(CxlDxe.obj) : unresolved external symbol __allmul
CxlDxe(CxlDxe.obj) : unresolved external symbol __allshl

CxlDxe is not intended to run on IA32 DXE systems, as such
systems are legacy, but until edk2 drops build support for
IA32 DXE (or at least CI for it), the build needs to work.

This fixes the 64 bit multiplication/shifting that occurs
in CxlDxe to use the BaseLib functions that avoid the
compiler intrinsics.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-06-25 15:15:38 +00:00
Dongyan Qian
5ac1b95b3e MdeModulePkg/PciBusDxe: Scan funcs when func 0 is absent
The PCI specification normally requires function 0 to be present
before functions 1 through 7 are used. PciBusDxe therefore stops
scanning a slot when probing function 0 fails.

Some virtualized PCI topologies may expose selected non-zero functions
to a guest while function 0 is hidden. Add an opt-in Feature PCD so a
platform can continue collecting device information for functions 1
through 7 when function 0 is absent.

The default remains FALSE, so existing platform behavior is unchanged
unless the platform explicitly enables the PCD.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-06-25 13:09:52 +00:00
Phineas Su
6d127c2140 ManageabilityPkg: Fix IPMI vulnerabilities and memory leak
Fix vulnerabilities and a memory leak in the IPMI Blob Transfer driver:
- Prevent integer underflow and OOB read by validating response size before
  accessing CompletionCode, OEN, and CRC.
- Prevent buffer overflow by ensuring BMC response size does not exceed the
  caller's buffer capacity, avoiding potential memory overwriting.
- Fix memory leak by freeing IpmiResponseData and IpmiSendData.

Additionally, fix unit test failures caused by the changes and pre-existing bugs:
- Allocate a safe fixed size (70 bytes) for IpmiResponseData in
  IpmiBlobTransferSendIpmi to prevent heap overflow if the BMC returns
  more data than expected. Add validation to check if returned size
  exceeds this allocation.
- Modify IpmiBlobTransferStat and IpmiBlobTransferSessionStat to only
  copy MetaDataLen bytes of metadata instead of always copying the max
  size (64 bytes), preventing buffer overflow when caller allocates
  a smaller buffer.
- Add missing ASSERT(FALSE) in IpmiBlobTransferStat parameter validation.
- Fix IpmiBlobTransferWriteMeta parameter validation to allow 0-length
  writes (Data can be NULL when WriteLength is 0), which was causing
  test failure.
- Fix syntax errors in unit tests where arrays were assigned values
  after declaration using brace-enclosed lists.
- Fix sizeof misuse on macros representing size values in unit tests,
  which caused too small allocations and buffer overflows in mock setups.
- Fix queue order in OpenValidResponse test to match the actual call
  order (GetCount, Enumerate, Open) and free all mock buffers.
- Remove unnecessary MockIpmiSubmitCommand calls from invalid buffer
  tests to prevent mock queue leaks to subsequent tests.
- Fix memory leaks of ExpectedMetadata in unit tests by changing them
  to static arrays.

Signed-off-by: Phineas Su <pohaosu@google.com>
2026-06-25 03:33:25 +00:00
Michael Kubacki
b3f57868ce NetworkPkg/UefiPxeBcDxe: Initialize IPV4 token in IPV4 branch
EfiPxeBcStart() in PxeBcImpl.c has conditional code branches for
IPV4 and IPV6.

- IPV4 branch should use EFI_IP4_COMPLETION_TOKEN which is
Private->IcmpToken.
- IPV6 branch should use EFI_IP6_COMPLETION_TOKEN which is
Private->Icmp6Token.

Right now, the IPv4 branch incorrectly initializes
Private->Icmp6Token to EFI_NOT_READY. That is changed to
Private->IcmpToken.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-25 01:13:27 +00:00
Michael Kubacki
c4130fc591 .pytool/EccCheck: Report package-relative paths in ECC findings
The EccCheck plugin currently reports incorrect paths that are
confusing to a user, such as:

```
*file: C:\src\edk2\Build\.pytool\Plugin\EccCheck\MdePkg\Include\
       Protocol\AuthenticationInfo.h
```

This is because the EccCheck plugin does not scan the package in
place. Before running ECC, it copies the package into
`Build/.pytool/Plugin/EccCheck/` and points the ECC tool at that
temporary location. As a result, the paths ECC records in its report
refer to the temporary copy rather than the file in the actual source
tree.

This affected two fields that are printed:

  - The "file:" line is taken from ECC's File column (`row[3]`), which
    holds the absolute path of the scanned file. It always pointed
    into the temporary scan directory.

  - The descriptive message (`row[5]`) paths were prefixed with
    `Build/.pytool/Plugin/EccCheck/`.

The temporary path is an internal build detail and prevents resolution
against the actual source file.

This change translates the reported paths back to the package-relative
path before printing.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-06-24 20:46:15 +00:00
Vignesh G
56cad12011 SecurityPkg: Add sanity check for File and FileBuffer inputs
Ensure that either File or FileBuffer is provided before proceeding with
security verification. If both are NULL, return EFI_INVALID_PARAMETER.
This prevents verification from running without a valid input buffer and
aligns with the intended design, where File is optional and FileBuffer
alone is sufficient.

Signed-off-by: Vignesh G <vigneshg@ami.com>
2026-06-24 17:51:16 +00:00