public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/edk2] rawhide: NetworkPkg/UefiPxeBcDxe: Fix ICMP buffer overflow in IPv4/IPv6 handlers (CVE-2026-97631)
@ 2026-10-26 11:54 Gerd Hoffmann
  0 siblings, 0 replies; only message in thread
From: Gerd Hoffmann @ 2026-10-26 11:54 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/edk2
            Branch : rawhide
            Commit : 7cdf76fd2fcf2a9b063fc4d485db2e9f4e72c6cb
            Author : Gerd Hoffmann <kraxel@redhat.com>
            Date   : 2026-10-26T12:49:51+01:00
            Stats  : +128/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/edk2/c/7cdf76fd2fcf2a9b063fc4d485db2e9f4e72c6cb?branch=rawhide

            Log:
            NetworkPkg/UefiPxeBcDxe: Fix ICMP buffer overflow in IPv4/IPv6 handlers (CVE-2026-97631)

Resolves: rhbz#2559889

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

---
diff --git a/0017-NetworkPkg-UefiPxeBcDxe-Fix-ICMP-buffer-overflow-in-.patch b/0017-NetworkPkg-UefiPxeBcDxe-Fix-ICMP-buffer-overflow-in-.patch
new file mode 100644
index 0000000..27e46eb
--- /dev/null
+++ b/0017-NetworkPkg-UefiPxeBcDxe-Fix-ICMP-buffer-overflow-in-.patch
@@ -0,0 +1,127 @@
+From 91557c178a59b41ea36a28e119a1192f0aa1c19c Mon Sep 17 00:00:00 2001
+From: santhoshkumarv <santhoshkumarv@ami.com>
+Date: Mon, 28 Sep 2026 06:06:24 -0700
+Subject: [PATCH 17/17] NetworkPkg/UefiPxeBcDxe: Fix ICMP buffer overflow in
+ IPv4/IPv6 handlers (CVE-2026-97631)
+
+Root Cause:
+Incorrect buffer copy logic in ICMP error handling allowed large packets
+to write beyond the allocated buffer. This could overwrite adjacent memory
+with attacker-controlled data, causing memory corruption.
+
+Resolution:
+Added proper boundary checks and corrected buffer offset calculations
+in IPv4 and IPv6 ICMP error handlers. Over sized ICMP error packets are now
+safely truncated when the buffer is full, preventing memory corruption.
+
+Signed-off-by: santhoshkumarV <santhoshkumarv@ami.com>
+(cherry picked from commit 560ed9b5b146ed622d7eb7c40254a9099bd65b84)
+---
+ NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c | 68 ++++++++++----------------
+ 1 file changed, 26 insertions(+), 42 deletions(-)
+
+diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
+index 887ea3e7d7d8..9e97ba4904c7 100644
+--- a/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
++++ b/NetworkPkg/UefiPxeBcDxe/PxeBcSupport.c
+@@ -252,6 +252,7 @@ PxeBcIcmpErrorDpcHandle (
+   UINTN                   Index;
+   UINT32                  CopiedLen;
+   UINT8                   *IcmpError;
++  UINT32                  FragmentLen;
+ 
+   Private = (PXEBC_PRIVATE_DATA *)Context;
+   Mode    = &Private->Mode;
+@@ -317,28 +318,19 @@ PxeBcIcmpErrorDpcHandle (
+   }
+ 
+   //
+-  // Copy the right ICMP error message into mode data.
++  // Copy ICMP error fragments into Mode->IcmpError in order. The maximum
++  // buffer size is sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR); truncate any excess.
+   //
+-  CopiedLen = 0;
+-  IcmpError = (UINT8 *)&Mode->IcmpError;
+-
+-  for (Index = 0; Index < RxData->FragmentCount; Index++) {
+-    CopiedLen += RxData->FragmentTable[Index].FragmentLength;
+-    if (CopiedLen <= sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR)) {
+-      CopyMem (
+-        IcmpError,
+-        RxData->FragmentTable[Index].FragmentBuffer,
+-        RxData->FragmentTable[Index].FragmentLength
+-        );
+-    } else {
+-      CopyMem (
+-        IcmpError,
+-        RxData->FragmentTable[Index].FragmentBuffer,
+-        CopiedLen - sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR)
+-        );
+-    }
+-
+-    IcmpError += CopiedLen;
++  for (Index = 0, IcmpError = (UINT8 *)&Mode->IcmpError, CopiedLen = 0;
++       (Index < RxData->FragmentCount) &&
++       (CopiedLen < sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR));
++       Index++, IcmpError += FragmentLen, CopiedLen += FragmentLen)
++  {
++    FragmentLen = MIN (
++                    RxData->FragmentTable[Index].FragmentLength,
++                    (UINT32)(sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR) - CopiedLen)
++                    );
++    CopyMem (IcmpError, RxData->FragmentTable[Index].FragmentBuffer, FragmentLen);
+   }
+ 
+ ON_RECYCLE:
+@@ -387,6 +379,7 @@ PxeBcIcmp6ErrorDpcHandle (
+   UINT8                   Type;
+   UINT32                  CopiedLen;
+   UINT8                   *Icmp6Error;
++  UINT32                  FragmentLen;
+ 
+   Private = (PXEBC_PRIVATE_DATA *)Context;
+   Mode    = &Private->Mode;
+@@ -449,28 +442,19 @@ PxeBcIcmp6ErrorDpcHandle (
+   }
+ 
+   //
+-  // Copy the right ICMP6 error message into mode data.
++  // Copy ICMP error fragments into Mode->IcmpError in order. The maximum
++  // buffer size is sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR); truncate any excess.
+   //
+-  CopiedLen  = 0;
+-  Icmp6Error = (UINT8 *)&Mode->IcmpError;
+-
+-  for (Index = 0; Index < RxData->FragmentCount; Index++) {
+-    CopiedLen += RxData->FragmentTable[Index].FragmentLength;
+-    if (CopiedLen <= sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR)) {
+-      CopyMem (
+-        Icmp6Error,
+-        RxData->FragmentTable[Index].FragmentBuffer,
+-        RxData->FragmentTable[Index].FragmentLength
+-        );
+-    } else {
+-      CopyMem (
+-        Icmp6Error,
+-        RxData->FragmentTable[Index].FragmentBuffer,
+-        CopiedLen - sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR)
+-        );
+-    }
+-
+-    Icmp6Error += CopiedLen;
++  for (Index = 0, Icmp6Error = (UINT8 *)&Mode->IcmpError, CopiedLen = 0;
++       (Index < RxData->FragmentCount) &&
++       (CopiedLen < sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR));
++       Index++, Icmp6Error += FragmentLen, CopiedLen += FragmentLen)
++  {
++    FragmentLen = MIN (
++                    RxData->FragmentTable[Index].FragmentLength,
++                    (UINT32)(sizeof (EFI_PXE_BASE_CODE_ICMP_ERROR) - CopiedLen)
++                    );
++    CopyMem (Icmp6Error, RxData->FragmentTable[Index].FragmentBuffer, FragmentLen);
+   }
+ 
+ ON_RECYCLE:
+-- 
+2.56.0
+

diff --git a/edk2.spec b/edk2.spec
index 2793f62..0aaa775 100644
--- a/edk2.spec
+++ b/edk2.spec
@@ -144,6 +144,7 @@ Patch0015: 0015-Revert-OvmfPkg-X86QemuLoadImageLib-flip-default-for-.patch
 Patch0016: 0016-OvmfPkg-PlatformDxe-proper-addr-masking.patch
 %if 0%{?fedora} >= 38 || 0%{?rhel} >= 10
 %endif
+Patch0017: 0017-NetworkPkg-UefiPxeBcDxe-Fix-ICMP-buffer-overflow-in-.patch
 
 
 # needed by %prep

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-26 11:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-26 11:54 [rpms/edk2] rawhide: NetworkPkg/UefiPxeBcDxe: Fix ICMP buffer overflow in IPv4/IPv6 handlers (CVE-2026-97631) Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox