Skip to content

Commit d143993

Browse files
[AutoPR- Security] Patch hvloader for CVE-2025-3770 [MEDIUM] (#14489)
Co-authored-by: jykanase <[email protected]>
1 parent 4dc8101 commit d143993

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

SPECS-SIGNED/hvloader-signed/hvloader-signed.spec

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Summary: Signed HvLoader.efi for %{buildarch} systems
77
Name: hvloader-signed-%{buildarch}
88
Version: 1.0.1
9-
Release: 13%{?dist}
9+
Release: 14%{?dist}
1010
License: MIT
1111
Vendor: Microsoft Corporation
1212
Distribution: Mariner
@@ -69,6 +69,9 @@ popd
6969
/boot/efi/HvLoader.efi
7070

7171
%changelog
72+
* Tue Aug 12 2025 Azure Linux Security Servicing Account <[email protected]> - 1.0.1-14
73+
- Bump release for consistency with hvloader spec.
74+
7275
* Tue May 13 2025 Archana Shettigar <[email protected]> - 1.0.1-13
7376
- Bump release for consistency with hvloader spec.
7477

SPECS/hvloader/CVE-2025-3770.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
From 6171f6700357bc265b083628451e4a1b72d7f5e0 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: Azure Linux Security Servicing Account <[email protected]>
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 d302ca8d..017576ff 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/hvloader/hvloader.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Summary: HvLoader.efi is an EFI application for loading an external hypervisor loader.
55
Name: hvloader
66
Version: 1.0.1
7-
Release: 13%{?dist}
7+
Release: 14%{?dist}
88
License: MIT
99
Vendor: Microsoft Corporation
1010
Distribution: Mariner
@@ -34,6 +34,7 @@ Patch16: CVE-2022-36765.patch
3434
Patch17: CVE-2023-45237.patch
3535
Patch18: CVE-2023-45236.patch
3636
Patch19: CVE-2024-38796.patch
37+
Patch20: CVE-2025-3770.patch
3738

3839
BuildRequires: bc
3940
BuildRequires: gcc
@@ -79,6 +80,9 @@ cp ./Build/MdeModule/RELEASE_GCC5/X64/MdeModulePkg/Application/%{name_github}-%{
7980
/boot/efi/HvLoader.efi
8081

8182
%changelog
83+
* Tue Aug 12 2025 Azure Linux Security Servicing Account <[email protected]> - 1.0.1-14
84+
- Patch for CVE-2025-3770
85+
8286
* Tue May 13 2025 Archana Shettigar <[email protected]> - 1.0.1-13
8387
- Fix CVE-2024-38796 with an upstream patch
8488

0 commit comments

Comments
 (0)