mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
ovmf: fix CVE-2024-1298
Backport a fix from upstream to resolve CVE-2024-1298
https://github.com/tianocore/edk2/commit/284dbac43da752ee34825c8b3f6f9e8281cb5a19
(From OE-Core rev: af65d3e221fb239c2dd769ce109e78c720e35793)
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
f11c3027f4
commit
1eddf2a87f
+51
@@ -0,0 +1,51 @@
|
|||||||
|
From 63f29c180dd04d13614440740a8795ee422567b8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
Date: Fri, 22 Nov 2024 17:43:28 +0800
|
||||||
|
Subject: [PATCH] MdeModulePkg: Potential UINT32 overflow in S3 ResumeCount
|
||||||
|
|
||||||
|
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4677
|
||||||
|
|
||||||
|
Attacker able to modify physical memory and ResumeCount.
|
||||||
|
System will crash/DoS when ResumeCount reaches its MAX_UINT32.
|
||||||
|
|
||||||
|
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
|
||||||
|
Cc: Dandan Bi <dandan.bi@intel.com>
|
||||||
|
Cc: Liming Gao <gaoliming@byosoft.com.cn>
|
||||||
|
|
||||||
|
Signed-off-by: Pakkirisamy ShanmugavelX <shanmugavelx.pakkirisamy@intel.com>
|
||||||
|
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
|
||||||
|
|
||||||
|
CVE: CVE-2024-1298
|
||||||
|
Upstream-Status: Backport [https://github.com/tianocore/edk2/commit/284dbac43da752ee34825c8b3f6f9e8281cb5a19]
|
||||||
|
Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
|
||||||
|
---
|
||||||
|
.../FirmwarePerformancePei.c | 12 ++++++++----
|
||||||
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
|
||||||
|
index 2f2b2a80b2..2ba9215226 100644
|
||||||
|
--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
|
||||||
|
+++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c
|
||||||
|
@@ -112,11 +112,15 @@ FpdtStatusCodeListenerPei (
|
||||||
|
//
|
||||||
|
S3ResumeTotal = MultU64x32 (AcpiS3ResumeRecord->AverageResume, AcpiS3ResumeRecord->ResumeCount);
|
||||||
|
AcpiS3ResumeRecord->ResumeCount++;
|
||||||
|
- AcpiS3ResumeRecord->AverageResume = DivU64x32 (S3ResumeTotal + AcpiS3ResumeRecord->FullResume, AcpiS3ResumeRecord->ResumeCount);
|
||||||
|
+ if (AcpiS3ResumeRecord->ResumeCount > 0) {
|
||||||
|
+ AcpiS3ResumeRecord->AverageResume = DivU64x32 (S3ResumeTotal + AcpiS3ResumeRecord->FullResume, AcpiS3ResumeRecord->ResumeCount);
|
||||||
|
+ DEBUG ((DEBUG_INFO, "\nFPDT: S3 Resume Performance - AverageResume = 0x%x\n", AcpiS3ResumeRecord->AverageResume));
|
||||||
|
+ } else {
|
||||||
|
+ DEBUG ((DEBUG_ERROR, "\nFPDT: S3 ResumeCount reaches the MAX_UINT32 value. S3 ResumeCount record reset to Zero."));
|
||||||
|
+ }
|
||||||
|
|
||||||
|
- DEBUG ((DEBUG_INFO, "FPDT: S3 Resume Performance - ResumeCount = %d\n", AcpiS3ResumeRecord->ResumeCount));
|
||||||
|
- DEBUG ((DEBUG_INFO, "FPDT: S3 Resume Performance - FullResume = %ld\n", AcpiS3ResumeRecord->FullResume));
|
||||||
|
- DEBUG ((DEBUG_INFO, "FPDT: S3 Resume Performance - AverageResume = %ld\n", AcpiS3ResumeRecord->AverageResume));
|
||||||
|
+ DEBUG ((DEBUG_INFO, "FPDT: S3 Resume Performance - ResumeCount = 0x%x\n", AcpiS3ResumeRecord->ResumeCount));
|
||||||
|
+ DEBUG ((DEBUG_INFO, "FPDT: S3 Resume Performance - FullResume = 0x%x\n", AcpiS3ResumeRecord->FullResume));
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update S3 Suspend Performance Record.
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
@@ -54,6 +54,7 @@ SRC_URI = "gitsm://github.com/tianocore/edk2.git;branch=master;protocol=https \
|
|||||||
file://CVE-2022-36765-0002.patch \
|
file://CVE-2022-36765-0002.patch \
|
||||||
file://CVE-2022-36765-0003.patch \
|
file://CVE-2022-36765-0003.patch \
|
||||||
file://0001-MdePkg-Fix-overflow-issue-in-BasePeCoffLib.patch \
|
file://0001-MdePkg-Fix-overflow-issue-in-BasePeCoffLib.patch \
|
||||||
|
file://0001-MdeModulePkg-Potential-UINT32-overflow-in-S3-ResumeC.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
PV = "edk2-stable202202"
|
PV = "edk2-stable202202"
|
||||||
|
|||||||
Reference in New Issue
Block a user