edk2/NetworkPkg
Marc Chen d3a64baf4b NetworkPkg/UefiPxeBcDxe: Add buffer check before reporting status code
When PxeBcLoadBootFile() fails, it reports a status code to notify
listeners (such as telemetry/SEL logging drivers) about the error.
However, the current implementation reports the status code for all
error conditions, including benign cases, such as where the caller passes
Buffer == NULL with EFI_BUFFER_TOO_SMALL to query the required size.

This causes false positive error reports in telemetry systems, as
EFI_BUFFER_TOO_SMALL with Buffer == NULL is an expected and normal
operation for size queries, not an actual error condition.

The PXE-E05 error message is already correctly guarded with the
condition "(Status == EFI_BUFFER_TOO_SMALL) && (Buffer != NULL)",
but the status code reporting was unconditional.

Add a buffer null check before REPORT_STATUS_CODE_WITH_EXTENDED_DATA
to ensure status codes are only reported for actual errors:
- Report when Status != EFI_BUFFER_TOO_SMALL (all other errors)
- Report when Status == EFI_BUFFER_TOO_SMALL AND Buffer != NULL (PXE-E05)
- Skip when Status == EFI_BUFFER_TOO_SMALL AND Buffer == NULL (size query)

This prevents spurious error logs while maintaining proper error
reporting for genuine failures including PXE-E05, PXE-E07, PXE-E09,
PXE-E99, and all other error conditions.

Signed-off-by: Marc Chen <marc.chen@microsoft.com>
2025-10-01 16:46:03 +00:00
..
Application/VConfig NetworkPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias 2025-10-01 10:02:57 +02:00
ArpDxe NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Dhcp4Dxe NetworkPkg: SECURITY PATCH CVE-2023-45237 2024-05-24 15:48:52 +00:00
Dhcp6Dxe NetworkPkg/Dhcp6Dxe/GoogleTest: Fix init of complex struct 2025-09-18 17:25:38 +00:00
DnsDxe NetworkPkg: SECURITY PATCH CVE-2023-45237 2024-05-24 15:48:52 +00:00
DpcDxe NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
HttpBootDxe NetworkPkg: Drop ARM32 Support 2025-09-25 22:04:10 +00:00
HttpDxe NetworkPkg: Correct spelling errors and typos 2025-07-04 09:41:47 +08:00
HttpUtilitiesDxe NetworkPkg/HttpUtilitiesDxe: Free handle buffers after LocateHandleBuffer 2025-06-12 14:09:13 +00:00
Include NetworkPkg/DxeNetLib: Fix CodeQl Error 2025-06-13 19:56:32 +00:00
Ip4Dxe NetworkPkg: SECURITY PATCH CVE-2023-45237 2024-05-24 15:48:52 +00:00
Ip6Dxe NetworkPkg: Use Library/GoogleTestLib.h 2025-06-24 19:32:41 +00:00
IScsiDxe NetworkPkg/IScsiDxe:Fix for out of bound memory access for bz4207 (CVE-2024-38805) 2025-05-13 15:16:07 +00:00
Library NetworkPkg: Drop ARM32 Support 2025-09-25 22:04:10 +00:00
MnpDxe NetworkPkg/MnpDxe: Convert TX buffer allocation messages to DEBUG_VERBOSE 2024-09-11 19:32:39 +00:00
Mtftp4Dxe NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Mtftp6Dxe NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SnpDxe NetworkPkg/SnpDxe: Shutdown SnpDxe on BeforeExitBootServices Event. 2025-01-17 01:43:51 +00:00
TcpDxe NetworkPkg TcpDxe: Fixed system stuck on PXE boot flow in iPXE environment 2024-05-30 21:06:38 +00:00
Test NetworkPkg: Drop ARM32 Support 2025-09-25 22:04:10 +00:00
TlsAuthConfigDxe NetworkPkg: Change 'Tls' to 'TLS' 2025-06-16 23:03:46 +00:00
TlsDxe NetworkPkg/TlsDxe: Add SNI support 2025-09-04 08:32:34 +00:00
Udp4Dxe NetworkPkg: SECURITY PATCH CVE-2023-45237 2024-05-24 15:48:52 +00:00
Udp6Dxe NetworkPkg: SECURITY PATCH CVE-2023-45237 2024-05-24 15:48:52 +00:00
UefiPxeBcDxe NetworkPkg/UefiPxeBcDxe: Add buffer check before reporting status code 2025-10-01 16:46:03 +00:00
VlanConfigDxe NetworkPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
WifiConnectionManagerDxe NetworkPkg/WifiConnectionManagerDxe: UI Disconnect 2025-08-25 18:24:32 +00:00
Network.dsc.inc NetworkPkg: Drop ARM32 Support 2025-09-25 22:04:10 +00:00
Network.fdf.inc NetworkPkg: PXE boot option build flag 2024-12-06 18:26:01 +00:00
NetworkBuildOptions.dsc.inc NetworkPkg: Remove RVCT support 2022-05-13 14:58:54 +00:00
NetworkComponents.dsc.inc NetworkPkg: PXE boot option build flag 2024-12-06 18:26:01 +00:00
NetworkDefines.dsc.inc NetworkPkg: PXE boot option build flag 2024-12-06 18:26:01 +00:00
NetworkDynamicPcds.dsc.inc NetworkPkg: Add PCD to control http boot enable or disable. 2025-06-11 19:07:48 +00:00
NetworkFixedPcds.dsc.inc NetworkPkg: mark fixed network PCDs 2024-11-11 13:38:51 +00:00
NetworkLibs.dsc.inc NetworkPkg: Add Http IO Helper Library to NetworkPkg 2020-12-04 11:45:07 +00:00
NetworkPkg.ci.yaml NetworkPkg: PXE boot option build flag 2024-12-06 18:26:01 +00:00
NetworkPkg.dec NetworkPkg: Add PCD to control http boot enable or disable. 2025-06-11 19:07:48 +00:00
NetworkPkg.dsc NetworkPkg: Drop ARM32 Support 2025-09-25 22:04:10 +00:00
NetworkPkg.uni NetworkPkg: Add PCD for HTTP transfer buffer size 2025-04-29 04:57:14 +00:00
NetworkPkgExtra.uni NetworkPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:15 -07:00
SecurityFixes.yaml NetworkPkg TcpDxe: SECURITY PATCH CVE-2023-45236 2024-05-24 15:48:52 +00:00