From 093387957c5c8fb0d69ce3feebdbcb6570f83faf Mon Sep 17 00:00:00 2001 From: lzq11122 Date: Thu, 3 Jul 2025 11:29:56 +0800 Subject: [PATCH] test Signed-off-by: lzq11122 --- 1008-CVE-2024-1298.patch | 37 +++++++++++++++++++++++++++++++++++++ edk2.spec | 7 ++++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 1008-CVE-2024-1298.patch diff --git a/1008-CVE-2024-1298.patch b/1008-CVE-2024-1298.patch new file mode 100644 index 0000000..4c425cf --- /dev/null +++ b/1008-CVE-2024-1298.patch @@ -0,0 +1,37 @@ +From 8691ad8e0b812870d6736f781685e7a29d7bc9d7 Mon Sep 17 00:00:00 2001 +From: lzq11122 +Date: Thu, 3 Jul 2025 11:25:14 +0800 +Subject: [PATCH 1/1] fix CVE-2024-1298 + +--- + .../FirmwarePerformancePei.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c +index 2f2b2a80..fbf329f7 100644 +--- a/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c ++++ b/MdeModulePkg/Universal/Acpi/FirmwarePerformanceDataTablePei/FirmwarePerformancePei.c +@@ -112,12 +112,14 @@ FpdtStatusCodeListenerPei ( + // + S3ResumeTotal = MultU64x32 (AcpiS3ResumeRecord->AverageResume, AcpiS3ResumeRecord->ResumeCount); + AcpiS3ResumeRecord->ResumeCount++; +- AcpiS3ResumeRecord->AverageResume = DivU64x32 (S3ResumeTotal + AcpiS3ResumeRecord->FullResume, AcpiS3ResumeRecord->ResumeCount); +- +- 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)); +- ++ 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 = 0x%x\n", AcpiS3ResumeRecord->ResumeCount)); ++ DEBUG ((DEBUG_INFO, "FPDT: S3 Resume Performance - FullResume = 0x%x\n", AcpiS3ResumeRecord->FullResume)); + // + // Update S3 Suspend Performance Record. + // +-- +2.43.5 + diff --git a/edk2.spec b/edk2.spec index 87b858e..29f187f 100644 --- a/edk2.spec +++ b/edk2.spec @@ -1,4 +1,4 @@ -%define anolis_release 15 +%define anolis_release 16 %undefine _auto_set_build_flags ExclusiveArch: x86_64 aarch64 loongarch64 riscv64 @@ -108,6 +108,8 @@ Patch1004: 1004-OvmfPkg-AmdSev-Add-missing-module-CsvDxe.patch # Encryption right out of the box. Patch1005: 1005-OvmfPkg-AmdSev-Integrate-grub2-x86_64-efi-modules-fr.patch Patch1006: 1006-MdePkg-Fix-overflow-issue-in-BasePeC.patch +#From https://github.com/tianocore/edk2/commit/284dbac43da752ee34825c8b3f6f9e8281cb5a19 +Patch1008: 1008-CVE-2024-1298.patch BuildRequires: python3-devel BuildRequires: libuuid-devel @@ -560,6 +562,9 @@ rm -f %{buildroot}%{_datadir}/edk2/riscv/*.raw %changelog +* Thu Jul 3 2025 lzq11122 - 202402-16 +- fix CVE-2024-1298 + * Tue Jun 24 2025 Qiangwei Zhang - 202402-15 - MdePkg: Fix overflow issue in BasePeCoffLib (CVE-2024-38796) -- Gitee