Skip to content

Commit 2ac46f1

Browse files
authored
[MEDIUM] Patch hvloader for CVE-2024-38796 (microsoft#13767)
1 parent b6476f7 commit 2ac46f1

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-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: 12%{?dist}
9+
Release: 13%{?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 May 13 2025 Archana Shettigar <[email protected]> - 1.0.1-13
73+
- Bump release for consistency with hvloader spec.
74+
7275
* Tue Apr 29 2025 Mayank Singh <[email protected]> - 1.0.1-12
7376
- Bump release for consistency with hvloader spec.
7477

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 8f5c0b8f6ffae9e6cebcef7703f40333714c2364 Mon Sep 17 00:00:00 2001
2+
From: archana25-ms <[email protected]>
3+
Date: Mon, 12 May 2025 14:02:08 +0000
4+
Subject: [PATCH] Address CVE-2024-38796
5+
6+
Upstream Patch Reference: https://github.com/tianocore/edk2/commit/c95233b8525ca6828921affd1496146cff262e65
7+
8+
---
9+
MdePkg/Library/BasePeCoffLib/BasePeCoff.c | 2 +-
10+
1 file changed, 1 insertion(+), 1 deletion(-)
11+
12+
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
13+
index 86ff2e76..128090d9 100644
14+
--- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
15+
+++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
16+
@@ -1054,7 +1054,7 @@ PeCoffLoaderRelocateImage (
17+
RelocDir = &Hdr.Te->DataDirectory[0];
18+
}
19+
20+
- if ((RelocDir != NULL) && (RelocDir->Size > 0)) {
21+
+ if ((RelocDir != NULL) && (RelocDir->Size > 0) && (RelocDir->Size - 1 < MAX_UINT32 - RelocDir->VirtualAddress)) {
22+
RelocBase = (EFI_IMAGE_BASE_RELOCATION *)PeCoffLoaderImageAddress (ImageContext, RelocDir->VirtualAddress, TeStrippedOffset);
23+
RelocBaseEnd = (EFI_IMAGE_BASE_RELOCATION *)PeCoffLoaderImageAddress (
24+
ImageContext,
25+
--
26+
2.45.3
27+

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: 12%{?dist}
7+
Release: 13%{?dist}
88
License: MIT
99
Vendor: Microsoft Corporation
1010
Distribution: Mariner
@@ -33,6 +33,7 @@ Patch15: CVE-2022-36763_CVE-2023-36764.patch
3333
Patch16: CVE-2022-36765.patch
3434
Patch17: CVE-2023-45237.patch
3535
Patch18: CVE-2023-45236.patch
36+
Patch19: CVE-2024-38796.patch
3637

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

8081
%changelog
82+
* Tue May 13 2025 Archana Shettigar <[email protected]> - 1.0.1-13
83+
- Fix CVE-2024-38796 with an upstream patch
84+
8185
* Tue Apr 29 2025 Mayank Singh <[email protected]> - 1.0.1-12
8286
- Fix CVE-2023-45236 and CVE-2023-45237 with an upstream patch
8387

0 commit comments

Comments
 (0)