Skip to content

Commit 5671f8f

Browse files
[AutoPR- Security] Patch edk2 for CVE-2025-3770 [MEDIUM] (#14473)
Co-authored-by: kgodara912 <[email protected]>
1 parent 76c1706 commit 5671f8f

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

SPECS/edk2/CVE-2025-3770.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From bbbab1679f5d9ea5f883219d5cde810cf60b1273 Mon Sep 17 00:00:00 2001
2+
From: John Mathews <[email protected]>
3+
Date: Fri, 30 May 2025 11:06:49 -0700
4+
Subject: [PATCH] UefiCpuPkg/PiSmmCpuDxeSmm: Safe handling of IDT register on
5+
SMM entry
6+
7+
Mitigates CVE-2025-3770
8+
9+
Do not assume that IDT.limit is loaded with a zero value upon SMM entry.
10+
Delay enabling Machine Check Exceptions in SMM until after the SMM IDT
11+
has been reloaded.
12+
13+
Signed-off-by: John Mathews <[email protected]>
14+
Signed-off-by: rpm-build <rpm-build>
15+
Upstream-reference: https://github.com/tianocore/edk2/commit/d2d8d38ee08c5e602fb092f940dfecc1f5a4eb38.patch
16+
---
17+
UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 6 +++++-
18+
1 file changed, 5 insertions(+), 1 deletion(-)
19+
20+
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
21+
index d302ca8..d797f09 100644
22+
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
23+
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
24+
@@ -126,7 +126,7 @@ ProtFlatMode:
25+
mov eax, strict dword 0 ; source operand will be patched
26+
ASM_PFX(gPatchSmiCr3):
27+
mov cr3, rax
28+
- mov eax, 0x668 ; as cr4.PGE is not set here, refresh cr3
29+
+ mov eax, 0x628 ; as cr4.PGE is not set here, refresh cr3
30+
31+
mov cl, strict byte 0 ; source operand will be patched
32+
ASM_PFX(gPatch5LevelPagingNeeded):
33+
@@ -217,6 +217,10 @@ SmiHandlerIdtrAbsAddr:
34+
mov ax, [rbx + DSC_SS]
35+
mov ss, eax
36+
37+
+ mov rax, cr4 ; enable MCE
38+
+ bts rax, 6
39+
+ mov cr4, rax
40+
+
41+
mov rbx, [rsp + 0x8] ; rbx <- CpuIndex
42+
43+
; enable CET if supported
44+
--
45+
2.45.4
46+

SPECS/edk2/edk2.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ExclusiveArch: x86_64
4545

4646
Name: edk2
4747
Version: %{GITDATE}git%{GITCOMMIT}
48-
Release: 42%{?dist}
48+
Release: 43%{?dist}
4949
Summary: UEFI firmware for 64-bit virtual machines
5050
License: BSD-2-Clause-Patent and OpenSSL and MIT
5151
URL: http://www.tianocore.org
@@ -132,6 +132,7 @@ Patch1003: CVE-2023-2650.patch
132132
Patch1004: improve-safety-of-DH.patch
133133
Patch1005: vendored-openssl-1.1.1-Only-free-the-read-buffers-if-we-re-not-using-them.patch
134134
Patch1006: CVE-2022-4304.patch
135+
Patch1007: CVE-2025-3770.patch
135136

136137
# python3-devel and libuuid-devel are required for building tools.
137138
# python3-devel is also needed for varstore template generation and
@@ -715,6 +716,9 @@ $tests_ok
715716

716717

717718
%changelog
719+
* Mon Aug 11 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 20230301gitf80f052277c8-43
720+
- Patch for CVE-2025-3770
721+
718722
* Fri May 02 2025 Ankita Pareek <ankitapareek@microsoft.com> - 20230301gitf80f052277c8-42
719723
- Add patch for CVE-2024-38796 CVE-2023-45229, CVE-2023-45231, CVE-2022-4304
720724

0 commit comments

Comments
 (0)