Skip to content

Commit a4da3b4

Browse files
CBL-Mariner-Botazurelinux-securityBinduSri-6522866Kanishk Bansaljslobodzian
authored
[AUTO-CHERRYPICK] [AutoPR- Security] Patch hvloader for CVE-2026-22795, CVE-2025-69421, CVE-2025-69420, CVE-2025-69419 [HIGH] - branch main (#15829)
Signed-off-by: Kanishk Bansal <kanbansal@microsoft.com> Co-authored-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> Co-authored-by: BinduSri-6522866 <v-badabala@microsoft.com> Co-authored-by: Kanishk Bansal <kanbansal@microsoft.com> Co-authored-by: jslobodzian <joslobo@microsoft.com>
1 parent 8fb8d1c commit a4da3b4

7 files changed

Lines changed: 168 additions & 10 deletions

File tree

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

Lines changed: 8 additions & 2 deletions
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: 17%{?dist}
9+
Release: 18%{?dist}
1010
License: MIT
1111
Vendor: Microsoft Corporation
1212
Distribution: Mariner
@@ -69,7 +69,10 @@ popd
6969
/boot/efi/HvLoader.efi
7070

7171
%changelog
72-
* Mon Feb 02 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-17
72+
* Sun Feb 15 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-18
73+
- Bump release for consistency with hvloader spec.
74+
75+
* Mon Feb 09 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-17
7376
- Bump release for consistency with hvloader spec.
7477

7578
* Tue Jan 06 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-16
@@ -78,6 +81,9 @@ popd
7881
* Thu Nov 20 2025 Jyoti kanase <v-jykanase@microsoft.com> - 1.0.1-15
7982
- Bump release for consistency with hvloader spec.
8083

84+
* Thu Nov 20 2025 Jyoti kanase <v-jykanase@microsoft.com> - 1.0.1-15
85+
- Bump release for consistency with hvloader spec.
86+
8187
* Tue Aug 12 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-14
8288
- Bump release for consistency with hvloader spec.
8389

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
From 7c55e722e1ee27020d9e52df9a194c2e3a5ab4de Mon Sep 17 00:00:00 2001
2+
From: AllSpark <allspark@microsoft.com>
3+
Date: Mon, 9 Feb 2026 11:04:29 +0000
4+
Subject: [PATCH] Check return code of UTF8_putc: handle failure in ASN.1
5+
string conversion and PKCS12 UTF-8 emission per upstream patch. Preserves
6+
comments from patch.
7+
8+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
9+
Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/41be0f216404f14457bbf3b9cc488dba60b49296.patch
10+
---
11+
.../Library/OpensslLib/openssl/crypto/asn1/a_strex.c | 6 ++++--
12+
.../OpensslLib/openssl/crypto/pkcs12/p12_utl.c | 11 +++++++++--
13+
2 files changed, 13 insertions(+), 4 deletions(-)
14+
15+
diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c
16+
index 284dde27..843b0f94 100644
17+
--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c
18+
+++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/asn1/a_strex.c
19+
@@ -203,8 +203,10 @@ static int do_buf(unsigned char *buf, int buflen,
20+
orflags = CHARTYPE_LAST_ESC_2253;
21+
if (type & BUF_TYPE_CONVUTF8) {
22+
unsigned char utfbuf[6];
23+
- int utflen;
24+
- utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c);
25+
+ int utflen = UTF8_putc(utfbuf, sizeof(utfbuf), c);
26+
+
27+
+ if (utflen < 0)
28+
+ return -1; /* error happened with UTF8 */
29+
for (i = 0; i < utflen; i++) {
30+
/*
31+
* We don't need to worry about setting orflags correctly
32+
diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c
33+
index 43b9e3a5..1c6b59d5 100644
34+
--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c
35+
+++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_utl.c
36+
@@ -207,8 +207,15 @@ char *OPENSSL_uni2utf8(const unsigned char *uni, int unilen)
37+
/* re-run the loop emitting UTF-8 string */
38+
for (asclen = 0, i = 0; i < unilen; ) {
39+
j = bmp_to_utf8(asctmp+asclen, uni+i, unilen-i);
40+
- if (j == 4) i += 4;
41+
- else i += 2;
42+
+ /* when UTF8_putc fails */
43+
+ if (j < 0) {
44+
+ OPENSSL_free(asctmp);
45+
+ return NULL;
46+
+ }
47+
+ if (j == 4)
48+
+ i += 4;
49+
+ else
50+
+ i += 2;
51+
asclen += j;
52+
}
53+
54+
--
55+
2.45.4
56+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From dbb834e047a19711836cb61561d9273e89f320fa Mon Sep 17 00:00:00 2001
2+
From: AllSpark <allspark@microsoft.com>
3+
Date: Mon, 9 Feb 2026 11:04:59 +0000
4+
Subject: [PATCH] Verify ASN1 object's types before attempting to access them
5+
as a particular type
6+
MIME-Version: 1.0
7+
Content-Type: text/plain; charset=UTF-8
8+
Content-Transfer-Encoding: 8bit
9+
10+
Issue was reported in ossl_ess_get_signing_cert but is also present in ossl_ess_get_signing_cert_v2.
11+
12+
Fixes: https://github.com/openssl/srt/issues/61
13+
Fixes CVE-2025-69420
14+
15+
Reviewed-by: Norbert Pocs <norbertp@openssl.org>
16+
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
17+
Reviewed-by: Tomas Mraz <tomas@openssl.org>
18+
MergeDate: Mon Jan 26 19:53:36 2026
19+
(cherry picked from commit ea8fc4c345fbd749048809c9f7c881ea656b0b94)
20+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
21+
Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/ea8fc4c345fbd749048809c9f7c881ea656b0b94.patch
22+
---
23+
.../Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c | 4 ++--
24+
1 file changed, 2 insertions(+), 2 deletions(-)
25+
26+
diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c
27+
index 7fe3d27e..5d452d26 100644
28+
--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c
29+
+++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/ts/ts_rsp_verify.c
30+
@@ -262,7 +262,7 @@ static ESS_SIGNING_CERT *ess_get_signing_cert(PKCS7_SIGNER_INFO *si)
31+
ASN1_TYPE *attr;
32+
const unsigned char *p;
33+
attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificate);
34+
- if (!attr)
35+
+ if (attr == NULL || attr->type != V_ASN1_SEQUENCE)
36+
return NULL;
37+
p = attr->value.sequence->data;
38+
return d2i_ESS_SIGNING_CERT(NULL, &p, attr->value.sequence->length);
39+
@@ -274,7 +274,7 @@ static ESS_SIGNING_CERT_V2 *ess_get_signing_cert_v2(PKCS7_SIGNER_INFO *si)
40+
const unsigned char *p;
41+
42+
attr = PKCS7_get_signed_attribute(si, NID_id_smime_aa_signingCertificateV2);
43+
- if (attr == NULL)
44+
+ if (attr == NULL || attr->type != V_ASN1_SEQUENCE)
45+
return NULL;
46+
p = attr->value.sequence->data;
47+
return d2i_ESS_SIGNING_CERT_V2(NULL, &p, attr->value.sequence->length);
48+
--
49+
2.45.4
50+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From d69f898077165b522ae19bf1a24b10c7a5367835 Mon Sep 17 00:00:00 2001
2+
From: AllSpark <allspark@microsoft.com>
3+
Date: Mon, 9 Feb 2026 11:05:00 +0000
4+
Subject: [PATCH] PKCS12_item_decrypt_d2i(): Check oct argument for NULL
5+
6+
Backport of upstream fix to validate ASN1_OCTET_STRING argument before use.
7+
Prevents NULL dereference when oct is NULL.
8+
9+
Inspired by upstream patch for PKCS12_item_decrypt_d2i_ex().
10+
11+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
12+
Upstream-reference: AI Backport of https://github.com/openssl/openssl/commit/2c13bf15286328641a805eb3b7c97e27d42881fb.patch
13+
---
14+
.../Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c | 7 +++++++
15+
1 file changed, 7 insertions(+)
16+
17+
diff --git a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c
18+
index 3c860584..85835734 100644
19+
--- a/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c
20+
+++ b/CryptoPkg/Library/OpensslLib/openssl/crypto/pkcs12/p12_decr.c
21+
@@ -88,6 +88,13 @@ void *PKCS12_item_decrypt_d2i(const X509_ALGOR *algor, const ASN1_ITEM *it,
22+
void *ret;
23+
int outlen;
24+
25+
+
26+
+ /* Check oct for NULL to avoid dereferencing a NULL pointer */
27+
+ if (oct == NULL) {
28+
+ PKCS12err(PKCS12_F_PKCS12_ITEM_DECRYPT_D2I, ERR_R_PASSED_NULL_PARAMETER);
29+
+ return NULL;
30+
+ }
31+
+
32+
if (!PKCS12_pbe_crypt(algor, pass, passlen, oct->data, oct->length,
33+
&out, &outlen, 0)) {
34+
PKCS12err(PKCS12_F_PKCS12_ITEM_DECRYPT_D2I,
35+
--
36+
2.45.4
37+
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 73b2e98599a813f617b20d5860e2587b385b4aff Mon Sep 17 00:00:00 2001
1+
From 1cbd2e0aef0cc6f6b6300408835cd6a3078c1ac4 Mon Sep 17 00:00:00 2001
22
From: Bob Beck <beck@openssl.org>
33
Date: Wed, 7 Jan 2026 11:29:48 -0700
44
Subject: [PATCH] Ensure ASN1 types are checked before use.

SPECS/hvloader/CVE-2026-22796.nopatch

Whitespace-only changes.

SPECS/hvloader/hvloader.spec

Lines changed: 16 additions & 7 deletions
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: 17%{?dist}
7+
Release: 18%{?dist}
88
License: MIT
99
Vendor: Microsoft Corporation
1010
Distribution: Mariner
@@ -37,9 +37,14 @@ Patch19: CVE-2024-38796.patch
3737
Patch20: CVE-2025-3770.patch
3838
Patch21: CVE-2025-2296.patch
3939
Patch22: CVE-2025-2295.patch
40-
Patch23: CVE-2025-68160.patch
41-
Patch24: CVE-2025-69418.patch
42-
Patch25: CVE-2026-22796.patch
40+
Patch23: CVE-2025-69419.patch
41+
Patch24: CVE-2025-69420.patch
42+
Patch25: CVE-2025-69421.patch
43+
Patch26: CVE-2026-22795.patch
44+
Patch27: CVE-2025-68160.patch
45+
Patch28: CVE-2025-69418.patch
46+
Patch29: CVE-2026-22796.nopatch
47+
4348

4449
BuildRequires: bc
4550
BuildRequires: gcc
@@ -85,13 +90,17 @@ cp ./Build/MdeModule/RELEASE_GCC5/X64/MdeModulePkg/Application/%{name_github}-%{
8590
/boot/efi/HvLoader.efi
8691

8792
%changelog
88-
* Mon Feb 02 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-17
89-
- Patch for CVE-2026-22796, CVE-2025-68160, CVE-2025-69418
93+
* Sun Feb 15 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-18
94+
- Patch for CVE-2025-68160, CVE-2025-69418
95+
- Add nopatch for CVE-2026-22796(CVE-2026-22795 already has the fix)
96+
97+
* Mon Feb 09 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-17
98+
- Patch for CVE-2026-22795, CVE-2025-69421, CVE-2025-69420, CVE-2025-69419
9099

91100
* Tue Jan 06 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-16
92101
- Patch for CVE-2025-2295
93102

94-
* Wed Nov 20 2025 Jyoti kanase <v-jykanase@microsoft.com> - 1.0.1-15
103+
* Thu Nov 20 2025 Jyoti kanase <v-jykanase@microsoft.com> - 1.0.1-15
95104
- Patch for CVE-2025-2296
96105

97106
* Tue Aug 12 2025 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 1.0.1-14

0 commit comments

Comments
 (0)