Skip to content

Commit f939c32

Browse files
Patch gnutls for CVE-2026-42009
1 parent 80402a7 commit f939c32

2 files changed

Lines changed: 60 additions & 1 deletion

File tree

SPECS/gnutls/CVE-2026-42009.patch

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
From c98e21a34e93c5d76cfafd4e42af2e076b8122e7 Mon Sep 17 00:00:00 2001
2+
From: AllSpark <allspark@microsoft.com>
3+
Date: Mon, 25 May 2026 08:44:24 +0000
4+
Subject: [PATCH] lib/buffers: ensure packets with duplicate sequence but
5+
mismatched type are discarded; fix comparator to return 0 when sequence equal
6+
for stable sort (backport)
7+
8+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
9+
Upstream-reference: AI Backport of https://gitlab.com/gnutls/gnutls/-/commit/f01e21441e29052a6f0963840794c41d3b3ee66d.patch https://gitlab.com/gnutls/gnutls/-/commit/f341441fad91142897d83b44a175ffc8f925b76f.patch
10+
---
11+
lib/buffers.c | 21 +++++++++++++++------
12+
1 file changed, 15 insertions(+), 6 deletions(-)
13+
14+
diff --git a/lib/buffers.c b/lib/buffers.c
15+
index f419193..e412915 100644
16+
--- a/lib/buffers.c
17+
+++ b/lib/buffers.c
18+
@@ -845,10 +845,7 @@ static int handshake_compare(const void *_e1, const void *_e2)
19+
const handshake_buffer_st *e1 = _e1;
20+
const handshake_buffer_st *e2 = _e2;
21+
22+
- if (e1->sequence <= e2->sequence)
23+
- return 1;
24+
- else
25+
- return -1;
26+
+ return (e1->sequence < e2->sequence) - (e1->sequence > e2->sequence);
27+
}
28+
29+
#define SSL2_HEADERS 1
30+
@@ -967,8 +964,20 @@ static int merge_handshake_packet(gnutls_session_t session,
31+
int ret;
32+
33+
for (i = 0; i < session->internals.handshake_recv_buffer_size; i++) {
34+
- if (session->internals.handshake_recv_buffer[i].htype ==
35+
- hsk->htype) {
36+
+ if (session->internals.handshake_recv_buffer[i].sequence == hsk->sequence) {
37+
+ if (session->internals.handshake_recv_buffer[i].htype != hsk->htype) {
38+
+ _gnutls_audit_log(
39+
+ session,
40+
+ "Discarded unexpected handshake packet "
41+
+ "with duplicate sequence %d, but "
42+
+ "mismatched type %s (previously %s)\n",
43+
+ hsk->sequence,
44+
+ _gnutls_handshake2str(hsk->htype),
45+
+ _gnutls_handshake2str(
46+
+ session->internals.handshake_recv_buffer[i].htype));
47+
+ _gnutls_handshake_buffer_clear(hsk);
48+
+ return 0;
49+
+ }
50+
exists = 1;
51+
pos = i;
52+
break;
53+
--
54+
2.45.4
55+

SPECS/gnutls/gnutls.spec

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: The GnuTLS Transport Layer Security Library
22
Name: gnutls
33
Version: 3.8.3
4-
Release: 9%{?dist}
4+
Release: 10%{?dist}
55
License: GPLv3+ AND LGPLv2.1+
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -21,6 +21,7 @@ Patch8: CVE-2025-6395.patch
2121
Patch9: CVE-2025-13151.patch
2222
Patch10: CVE-2025-9820.patch
2323
Patch11: CVE-2026-33845.patch
24+
Patch12: CVE-2026-42009.patch
2425
BuildRequires: autogen-libopts-devel
2526
BuildRequires: gc-devel
2627
BuildRequires: libtasn1-devel
@@ -102,6 +103,9 @@ sed -i 's/TESTS += test-ciphers-openssl.sh//' tests/slow/Makefile.am
102103
%{_mandir}/man3/*
103104

104105
%changelog
106+
* Mon May 25 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 3.8.3-10
107+
- Patch for CVE-2026-42009
108+
105109
* Thu May 07 2026 Akarsh Chaudhary <v-akarshc@microsoft.com>- 3.8.3-9
106110
- Patch for CVE-2026-33845
107111

0 commit comments

Comments
 (0)