Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions SPECS/gnutls/CVE-2025-9820.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From 76fa80cc7cffcf3fdeb82c7dcdf426533a9efd08 Mon Sep 17 00:00:00 2001
From: AllSpark <[email protected]>
Date: Tue, 27 Jan 2026 16:57:26 +0000
Subject: [PATCH] pkcs11: avoid stack overwrite when initializing a token; add
label length note; use MIN guard; include minmax.h

Signed-off-by: Azure Linux Security Servicing Account <[email protected]>
Upstream-reference: AI Backport of https://gitlab.com/gnutls/gnutls/-/commit/1d56f96f6ab5034d677136b9d50b5a75dff0faf5.patch
---
lib/pkcs11_write.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c
index 3ce794b..5685411 100644
--- a/lib/pkcs11_write.c
+++ b/lib/pkcs11_write.c
@@ -28,6 +28,7 @@
#include "pkcs11x.h"
#include <x509/common.h>
#include "pk.h"
+#include "minmax.h"

static const ck_bool_t tval = 1;
static const ck_bool_t fval = 0;
@@ -1199,7 +1200,7 @@ int gnutls_pkcs11_delete_url(const char *object_url, unsigned int flags)
* gnutls_pkcs11_token_init:
* @token_url: A PKCS #11 URL specifying a token
* @so_pin: Security Officer's PIN
- * @label: A name to be used for the token
+ * @label: A name to be used for the token, at most 32 characters
*
* This function will initialize (format) a token. If the token is
* at a factory defaults state the security officer's PIN given will be
@@ -1238,7 +1239,7 @@ gnutls_pkcs11_token_init(const char *token_url,
/* so it seems memset has other uses than zeroing! */
memset(flabel, ' ', sizeof(flabel));
if (label != NULL)
- memcpy(flabel, label, strlen(label));
+ memcpy(flabel, label, MIN(sizeof(flabel), strlen(label)));

rv = pkcs11_init_token(module, slot, (uint8_t *) so_pin,
strlen(so_pin), (uint8_t *) flabel);
--
2.45.4

6 changes: 5 additions & 1 deletion SPECS/gnutls/gnutls.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Summary: The GnuTLS Transport Layer Security Library
Name: gnutls
Version: 3.7.11
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv3+ AND LGPLv2.1+
Vendor: Microsoft Corporation
Distribution: Mariner
Expand All @@ -15,6 +15,7 @@ Patch3: CVE-2025-32989.patch
Patch4: CVE-2025-32988.patch
Patch5: CVE-2025-32990.patch
Patch6: CVE-2025-13151.patch
Patch7: CVE-2025-9820.patch
BuildRequires: autogen-libopts-devel
BuildRequires: gc-devel
BuildRequires: guile-devel
Expand Down Expand Up @@ -101,6 +102,9 @@ sed -i 's/TESTS += test-ciphers-openssl.sh//' tests/slow/Makefile.am
%{_mandir}/man3/*

%changelog
* Tue Jan 27 2026 Azure Linux Security Servicing Account <[email protected]> - 3.7.11-6
- Patch for CVE-2025-9820

* Mon Jan 12 2026 Azure Linux Security Servicing Account <[email protected]> - 3.7.11-5
- Patch for CVE-2025-13151

Expand Down
Loading