From 649fe647114ca5dee84b0c55106ee58a9703984f Mon Sep 17 00:00:00 2001 From: Jon Maloy Date: Fri, 16 Feb 2024 10:48:05 -0500 Subject: [PATCH 15/15] NetworkPkg: Dhcp6Dxe: Packet-Length is not updated before appending RH-Author: Jon Maloy RH-MergeRequest: 56: Pixiefail issues in NetworkPkg package RH-Jira: RHEL-21840 RHEL-21844 RHEL-21846 RHEL-21848 RHEL-21850 RHEL-21852 RH-Acked-by: Gerd Hoffmann RH-Acked-by: Oliver Steffen RH-Commit: [15/15] bc7ef287311bb3f757bc26f8921875566bcb5917 JIRA: https://issues.redhat.com/browse/RHEL-21840 CVE: CVE-2023-45229 Upstream: Merged commit 75deaf5c3c0d164c61653258c331151241bb69d8 Author: Doug Flick Date: Tue Feb 13 10:46:02 2024 -0800 NetworkPkg: Dhcp6Dxe: Packet-Length is not updated before appending In order for Dhcp6AppendIaAddrOption (..) to safely append the IA Address option, the Packet-Length field must be updated before appending the option. Cc: Saloni Kasbekar Cc: Zachary Clark-williams Signed-off-by: Doug Flick [MSFT] Reviewed-by: Saloni Kasbekar Reviewed-by: Leif Lindholm Signed-off-by: Jon Maloy --- NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c index e172ffc2a2..c23eff8766 100644 --- a/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c +++ b/NetworkPkg/Dhcp6Dxe/Dhcp6Utility.c @@ -948,6 +948,11 @@ Dhcp6AppendIaOption ( *PacketCursor += sizeof (T2); } + // + // Update the packet length + // + Packet->Length += BytesNeeded; + // // Fill all the addresses belong to the Ia // @@ -959,11 +964,6 @@ Dhcp6AppendIaOption ( } } - // - // Update the packet length - // - Packet->Length += BytesNeeded; - // // Fill the value of Ia option length // -- 2.39.3