Skip to content

Commit daf2b69

Browse files
Patch edk2 for CVE-2025-3770
1 parent 0eca4fc commit daf2b69

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 48d5b0a7b11a656d3ff58542900d318ec811f638 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 644366b..6e1cd45 100644
22+
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
23+
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm
24+
@@ -113,7 +113,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+
@@ -204,6 +204,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
@@ -55,7 +55,7 @@ ExclusiveArch: x86_64
5555

5656
Name: edk2
5757
Version: %{GITDATE}git%{GITCOMMIT}
58-
Release: 8%{?dist}
58+
Release: 9%{?dist}
5959
Summary: UEFI firmware for 64-bit virtual machines
6060
License: Apache-2.0 AND (BSD-2-Clause OR GPL-2.0-or-later) AND BSD-2-Clause-Patent AND BSD-3-Clause AND BSD-4-Clause AND ISC AND MIT AND LicenseRef-Fedora-Public-Domain
6161
URL: https://www.tianocore.org
@@ -138,6 +138,7 @@ Patch1002: CVE-2024-4741.patch
138138
Patch1003: CVE-2024-13176.patch
139139
Patch1004: CVE-2024-2511.patch
140140
Patch1005: CVE-2024-4603.patch
141+
Patch1006: CVE-2025-3770.patch
141142

142143
# python3-devel and libuuid-devel are required for building tools.
143144
# python3-devel is also needed for varstore template generation and
@@ -799,6 +800,9 @@ done
799800
/boot/efi/HvLoader.efi
800801

801802
%changelog
803+
* Mon Aug 11 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 20240524git3e722403cd16-9
804+
- Patch for CVE-2025-3770
805+
802806
* Thu Apr 24 2025 Jyoti Kanase <v-jykanase@microsoft.com> - 20240524git3e722403cd16-8
803807
- Fix CVE-2024-38796
804808

0 commit comments

Comments
 (0)