gnutls: upgrade 3.8.10 -> 3.8.11
PATCH 1/4 gnutls: upgrade 3.8.10 -> 3.8.11
Release information: [1]
Includes fix for CVE-2025-9820.
Refresh patches.
Backport commit to be able to build with gcc<11 (e.g. Debian 11).
[1] https://lists.gnupg.org/pipermail/gnutls-help/2025-November/004906.html
(From OE-Core rev: 0224dd73d5e462e3ab0958a63d631aa32e330d6c)
Dropped CVE-2025-9820.patch
---
...ile-should-be-excuted-in-target-envi.patch | 2 +-
...dit-crau-fix-compilation-with-gcc-11.patch | 66 +++++
.../gnutls/gnutls/Add-ptest-support.patch | 6 +-
.../gnutls/gnutls/CVE-2025-9820.patch | 233 ------------------
.../{gnutls_3.8.10.bb => gnutls_3.8.11.bb} | 4 +-
5 files changed, 72 insertions(+), 239 deletions(-)
create mode 100644 meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch
delete mode 100644 meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
rename meta/recipes-support/gnutls/{gnutls_3.8.10.bb => gnutls_3.8.11.bb} (96%)meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch +1 -1
@@ -14,7 +14,7 @@ diff --git a/lib/Makefile.am b/lib/Makefile.am index a50d311..193ea19 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am -@@ -272,8 +272,7 @@ hmac_file = .libs/.$(gnutls_so).hmac +@@ -275,8 +275,7 @@ hmac_file = .libs/.$(gnutls_so).hmac all-local: $(hmac_file)
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +66 -0
66 lines not on this page · raw message
meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch +3 -3
@@ -15,7 +15,7 @@ diff --git a/Makefile.am b/Makefile.am index 843193f..816b09f 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -194,6 +194,9 @@ dist-hook: +@@ -197,6 +197,9 @@ dist-hook: distcheck-hook: @test -d "$(top_srcdir)/po/.reference" || { echo "PO files are not downloaded; run ./bootstrap without --skip-po"; exit 1; }
@@ -29,7 +29,7 @@ diff --git a/configure.ac b/configure.ac index 1744813..efb9e34 100644 --- a/configure.ac +++ b/configure.ac -@@ -1491,6 +1491,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) +@@ -1447,6 +1447,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
@@ -42,7 +42,7 @@ diff --git a/tests/Makefile.am b/tests/Makefile.am index 189d068..8430b05 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -678,6 +678,12 @@ SH_LOG_COMPILER = $(SHELL) +@@ -719,6 +719,12 @@ SH_LOG_COMPILER = $(SHELL) AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind LOG_COMPILER = $(LOG_VALGRIND)
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0 -233
233 lines not on this page · raw message
meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +2 -2
@@ -21,12 +21,12 @@ SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \ file://arm_eabi.patch \ file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \ + file://0001-audit-crau-fix-compilation-with-gcc-11.patch \ file://run-ptest \ file://Add-ptest-support.patch \ - file://CVE-2025-9820.patch \ " -SRC_URI[sha256sum] = "db7fab7cce791e7727ebbef2334301c821d79a550ec55c9ef096b610b03eb6b7" +SRC_URI[sha256sum] = "91bd23c4a86ebc6152e81303d20cf6ceaeb97bc8f84266d0faec6e29f17baa20" inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest
Signature · 1 line
2.43.0
PATCH 2/4 gnutls: fix postinst script for ${PN}-fips for multilibs
From: Liu Yiding <[email protected]>
Append "-p" parameter to mkdir to fix failure like following:
When use "gnutls-cli --fips140-mode" command in multilib environment, it shows library not found error.
root@qemux86-64:~# gnutls-cli --fips140-mode library is NOT in FIPS140-2 mode
And it was caused by lacking hmac files.
root@qemux86-64:~# ls /usr/lib64/.*hmac ls: cannot access '/usr/lib64/.libgnutl*': No such file or directory
The reason is as following:
When '${sysconfdir}/gnutls' was created by 'mkdir' with lib32-gnutls, the dir will not be created again by 'mkdir' with lib-gnutls again, and the subsequent command will not be executed, so hmac files were missing in lib64 environment.
${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmacSo append "-p" parameter can avoid this error.
(From OE-Core rev: 7b51969967e13779ed2f5a3134ff89f9f4ad8af5)
--- meta/recipes-support/gnutls/gnutls_3.8.11.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/gnutls/gnutls_3.8.11.bb +1 -1
@@ -91,7 +91,7 @@ BBCLASSEXTEND = "native nativesdk" pkg_postinst_ontarget:${PN}-fips () { if test -x ${bindir}/fipshmac then - mkdir ${sysconfdir}/gnutls + mkdir -p ${sysconfdir}/gnutls touch ${sysconfdir}/gnutls/config ${bindir}/fipshmac ${libdir}/libgnutls.so.30.*.* > ${libdir}/.libgnutls.so.30.hmac ${bindir}/fipshmac ${libdir}/libnettle.so.8.* > ${libdir}/.libnettle.so.8.hmac
Signature · 1 line
2.43.0
PATCH 3/4 gnutls: use libtool to install test binaries
In reply to Vijay AnusuriFrom: Ross Burton <[email protected]>
If libtool builds a binary it's best to use libtool to install it, as otherwise you might install a wrapper script or need to make assumptions about where libtool has put the real binary (as this isn't always .libs)
(From OE-Core rev: 675e8c730132ae02092400a0f4f170782afdbb60)
--- meta/recipes-support/gnutls/gnutls_3.8.11.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-support/gnutls/gnutls_3.8.11.bb +1 -1
@@ -71,7 +71,7 @@ do_compile_ptest() { do_install:append:class-target() { if ${@bb.utils.contains('PACKAGECONFIG', 'fips', 'true', 'false', d)}; then install -d ${D}${bindir}/bin - install -m 0755 ${B}/lib/.libs/fipshmac ${D}/${bindir}/ + ${B}/libtool --mode=install install -m 0755 ${B}/lib/fipshmac ${D}/${bindir}/ fi }
Signature · 1 line
2.43.0
PATCH 4/4 gnutls: upgrade 3.8.11 -> 3.8.12
In reply to Vijay AnusuriFrom: Peter Marko <[email protected]>
Release information: [1]
Solves CVE-2025-14831 and CVE-2026-1584.
Remove patch included in this release.
Add workaround for cross-compilation bug in release tarball.
[1] https://lists.gnutls.org/pipermail/gnutls-help/2026-February/004914.html
(From OE-Core rev: 49f8a79a705f4ff3d0ba755c637ef8f6ac09d5b6)
---
...dit-crau-fix-compilation-with-gcc-11.patch | 66 -------------------
.../gnutls/gnutls/Add-ptest-support.patch | 4 +-
.../{gnutls_3.8.11.bb => gnutls_3.8.12.bb} | 7 +-
3 files changed, 7 insertions(+), 70 deletions(-)
delete mode 100644 meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch
rename meta/recipes-support/gnutls/{gnutls_3.8.11.bb => gnutls_3.8.12.bb} (94%)meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch deleted +0 -66
@@ -1,66 +0,0 @@ -From 2bbae7644a2292410b53f98fd0035c40bf8750a5 Mon Sep 17 00:00:00 2001 -From: Julien Olivain <[email protected]> -Date: Sun, 23 Nov 2025 18:17:19 +0100 -Subject: [PATCH] audit: crau: fix compilation with gcc < 11 - -If the CRAU_MAYBE_UNUSED macro is unset, the crau.h file tries to -automatically detect an appropriate value for it. - -This autodetection is using the cpp special operator -`__has_c_attribute` [1], introduced in gcc 11 [2]. - -When compiling with a gcc older than version 11, the compilation fails -with the error: - - In file included from audit.h:22, - from audit.c:26: - crau/crau.h:255:23: error: missing binary operator before token "(" - __has_c_attribute (__maybe_unused__) - ^ - -This has been observed, for example, in Rocky Linux 8.10, which -contains a gcc v8.5.0. - -The issue happens because the test for the `__has_c_attribute` -availability and the test for the `__maybe_unused__` attribute -are in the same directive. Those tests should be separated in -two different directives, following the same logic described in -the `__has_builtin` documentation [3]. - -This issue was found in Buildroot, after updating gnutls to -version 3.8.11 in [4]. - -This commit fixes the issue by splitting the test in two. - -[1] https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fc_005fattribute.html -[2] https://gcc.gnu.org/gcc-11/changes.html#c -[3] https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fbuiltin.html -[4] https://gitlab.com/buildroot.org/buildroot/-/commit/81dbfe1c2ae848b4eb1f896198d13455df50e548 - -Reported-by: Neal Frager <[email protected]> -Signed-off-by: Julien Olivain <[email protected]> - -Upstream-Status: Backport [https://github.com/gnutls/gnutls/commit/2bbae7644a2292410b53f98fd0035c40bf8750a5] -Signed-off-by: Peter Marko <[email protected]> ---- - lib/crau/crau.h | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/lib/crau/crau.h b/lib/crau/crau.h -index 0d4f9f13e..53d33555b 100644 ---- a/lib/crau/crau.h -+++ b/lib/crau/crau.h -@@ -251,9 +251,10 @@ void crau_data(struct crau_context_stack_st *stack, ...) - # else - - # ifndef CRAU_MAYBE_UNUSED --# if defined(__has_c_attribute) && \ -- __has_c_attribute (__maybe_unused__) --# define CRAU_MAYBE_UNUSED [[__maybe_unused__]] -+# if defined(__has_c_attribute) -+# if __has_c_attribute (__maybe_unused__) -+# define CRAU_MAYBE_UNUSED [[__maybe_unused__]] -+# endif - # elif defined(__GNUC__) - # define CRAU_MAYBE_UNUSED __attribute__((__unused__)) - # endif
meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch +2 -2
@@ -29,7 +29,7 @@ diff --git a/configure.ac b/configure.ac index 1744813..efb9e34 100644 --- a/configure.ac +++ b/configure.ac -@@ -1447,6 +1447,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) +@@ -1448,6 +1448,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")
@@ -42,7 +42,7 @@ diff --git a/tests/Makefile.am b/tests/Makefile.am index 189d068..8430b05 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -719,6 +719,12 @@ SH_LOG_COMPILER = $(SHELL) +@@ -721,6 +721,12 @@ SH_LOG_COMPILER = $(SHELL) AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind LOG_COMPILER = $(LOG_VALGRIND)
meta/recipes-support/gnutls/gnutls_3.8.12.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.11.bb +5 -2
@@ -21,12 +21,11 @@ SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \ file://arm_eabi.patch \ file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \ - file://0001-audit-crau-fix-compilation-with-gcc-11.patch \ file://run-ptest \ file://Add-ptest-support.patch \ " -SRC_URI[sha256sum] = "91bd23c4a86ebc6152e81303d20cf6ceaeb97bc8f84266d0faec6e29f17baa20" +SRC_URI[sha256sum] = "a7b341421bfd459acf7a374ca4af3b9e06608dcd7bd792b2bf470bea012b8e51" inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest
@@ -62,6 +61,10 @@ do_configure:prepend() { for dir in . lib; do rm -f ${dir}/aclocal.m4 ${dir}/m4/libtool.m4 ${dir}/m4/lt*.m4 done + + # remove on next upgrade when release tarball gets fixed + # https://gitlab.com/gnutls/gnutls/-/issues/1797 + cp -p ${S}/doc/stamp_enums ${S}/doc/stamp_error_codes } do_compile_ptest() {
Signature · 1 line
2.43.0
Patchtest results for [OE-core][whinlatter][patch 1/4] gnutls: upgrade 3.8.10 -> 3.8.11
In reply to Vijay AnusuriThank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:
---
Testing patch /home/patchtest/share/mboxes/whinlatter-1-4-gnutls-upgrade-3.8.10---3.8.11.patch
FAIL: test CVE tag format: Missing or incorrectly formatted CVE tag in patch file. Correct or include the CVE tag in the patch with format: "CVE: CVE-YYYY-XXXX" (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)
SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
---
Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!
Quoted 18 lines · Vijay Anusuri via lists.openembedded.org
Release information: [1]
Includes fix for CVE-2025-9820.Refresh patches.
Backport commit to be able to build with gcc<11 (e.g. Debian 11).
[1] https://lists.gnupg.org/pipermail/gnutls-help/2025-November/004906.html
Signed-off-by Peter Marko <[email protected]>Signed-off-by Mathieu Dubois-Briand <[email protected]>Signed-off-by Richard Purdie <[email protected]>(From OE-Core rev:
0224dd73d5e462e3ab0958a63d631aa32e330d6c)Dropped CVE-2025-9820.patch
Signed-off-by Vijay Anusuri <[email protected]>
Quoted 10 lines
---
...ile-should-be-excuted-in-target-envi.patch | 2 +-
...dit-crau-fix-compilation-with-gcc-11.patch | 66 +++++
.../gnutls/gnutls/Add-ptest-support.patch | 6 +-
.../gnutls/gnutls/CVE-2025-9820.patch | 233 ------------------
.../{gnutls_3.8.10.bb => gnutls_3.8.11.bb} | 4 +-
5 files changed, 72 insertions(+), 239 deletions(-)
create mode 100644 meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch
delete mode 100644 meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
rename meta/recipes-support/gnutls/{gnutls_3.8.10.bb => gnutls_3.8.11.bb} (96%)Hello,
Sorry, but it look like this release mixes enhancement with bugs and CVE
fixes: https://lists.gnupg.org/pipermail/gnutls-help/2025-November/004906.html:
Quoted 14 lines
** libgnutls: MAC algorithms for PSK binders is now configurable [...]
** libgnutls: Expose a new function [...]
[...]
** libgnutls: Expose a new function [...]
[...]
** libgnutls: PKCS#11 cryptographic provider configuration takes a token URI
instead of a module path. [...]
[...]
** API and ABI modifications:gnutls_psk_allocate_client_credentials2: New function
[...]gnutls_audit_current_context: New function
I don't think it is suitable for stable inclusion. Same for patch 4/4 of this series.
I could take patches 2/4 and 3/4, but do they make sense without 1/4?
Regards,
Quoted 377 lines
meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch +1
-1@@ -14,7 +14,7 @@ diff --git a/lib/Makefile.am b/lib/Makefile.am index a50d311..193ea19 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am -@@ -272,8 +272,7 @@ hmac_file = .libs/.$(gnutls_so).hmac +@@ -275,8 +275,7 @@ hmac_file = .libs/.$(gnutls_so).hmac all-local: $(hmac_file)meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +66
-0@@ -0,0 +1,66 @@ +From 2bbae7644a2292410b53f98fd0035c40bf8750a5 Mon Sep 17 00:00:00 2001 +From: Julien Olivain <[email protected]> +Date: Sun, 23 Nov 2025 18:17:19 +0100 +Subject: [PATCH] audit: crau: fix compilation with gcc < 11 + +If the CRAU_MAYBE_UNUSED macro is unset, the crau.h file tries to +automatically detect an appropriate value for it. + +This autodetection is using the cpp special operator +`__has_c_attribute` [1], introduced in gcc 11 [2]. + +When compiling with a gcc older than version 11, the compilation fails +with the error: + + In file included from audit.h:22, + from audit.c:26: + crau/crau.h:255:23: error: missing binary operator before token "(" + __has_c_attribute (__maybe_unused__) + ^ + +This has been observed, for example, in Rocky Linux 8.10, which +contains a gcc v8.5.0. + +The issue happens because the test for the `__has_c_attribute` +availability and the test for the `__maybe_unused__` attribute +are in the same directive. Those tests should be separated in +two different directives, following the same logic described in +the `__has_builtin` documentation [3]. + +This issue was found in Buildroot, after updating gnutls to +version 3.8.11 in [4]. + +This commit fixes the issue by splitting the test in two. + +[1] https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fc_005fattribute.html +[2] https://gcc.gnu.org/gcc-11/changes.html#c +[3] https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fbuiltin.html +[4] https://gitlab.com/buildroot.org/buildroot/-/commit/81dbfe1c2ae848b4eb1f896198d13455df50e548 + +Reported-by: Neal Frager <[email protected]> +Signed-off-by: Julien Olivain <[email protected]> + +Upstream-Status: Backport [https://github.com/gnutls/gnutls/commit/2bbae7644a2292410b53f98fd0035c40bf8750a5] +Signed-off-by: Peter Marko <[email protected]> +--- + lib/crau/crau.h | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/lib/crau/crau.h b/lib/crau/crau.h +index 0d4f9f13e..53d33555b 100644 +--- a/lib/crau/crau.h ++++ b/lib/crau/crau.h +@@ -251,9 +251,10 @@ void crau_data(struct crau_context_stack_st *stack, ...) + # else + + # ifndef CRAU_MAYBE_UNUSED +-# if defined(__has_c_attribute) && \ +- __has_c_attribute (__maybe_unused__) +-# define CRAU_MAYBE_UNUSED [[__maybe_unused__]] ++# if defined(__has_c_attribute) ++# if __has_c_attribute (__maybe_unused__) ++# define CRAU_MAYBE_UNUSED [[__maybe_unused__]] ++# endif + # elif defined(__GNUC__) + # define CRAU_MAYBE_UNUSED __attribute__((__unused__)) + # endifmeta/recipes-support/gnutls/gnutls/Add-ptest-support.patch +3
-3@@ -15,7 +15,7 @@ diff --git a/Makefile.am b/Makefile.am index 843193f..816b09f 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -194,6 +194,9 @@ dist-hook: +@@ -197,6 +197,9 @@ dist-hook: distcheck-hook: @test -d "$(top_srcdir)/po/.reference" || { echo "PO files are not downloaded; run ./bootstrap without --skip-po"; exit 1; }@@ -29,7 +29,7 @@ diff --git a/configure.ac b/configure.ac index 1744813..efb9e34 100644 --- a/configure.ac +++ b/configure.ac -@@ -1491,6 +1491,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) +@@ -1447,6 +1447,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")@@ -42,7 +42,7 @@ diff --git a/tests/Makefile.am b/tests/Makefile.am index 189d068..8430b05 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -678,6 +678,12 @@ SH_LOG_COMPILER = $(SHELL) +@@ -719,6 +719,12 @@ SH_LOG_COMPILER = $(SHELL) AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind LOG_COMPILER = $(LOG_VALGRIND)meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-233@@ -1,233 +0,0 @@ -From 19ad448d0cc3dd6857b553a47728eead3ea8f445 Mon Sep 17 00:00:00 2001 -From: Daiki Ueno <[email protected]> -Date: Tue, 18 Nov 2025 13:17:55 +0900 -Subject: [PATCH] pkcs11: avoid stack overwrite when initializing a token - -If gnutls_pkcs11_token_init is called with label longer than 32 -characters, the internal storage used to blank-fill it would -overflow. This adds a guard to prevent that. - -CVE: CVE-2025-9820 -Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/1d56f96f6ab5034d677136b9d50b5a75dff0faf5] -Signed-off-by: Daiki Ueno <[email protected]> -Signed-off-by: Ankur Tyagi <[email protected]> ---- - lib/pkcs11_write.c | 5 +- - tests/Makefile.am | 2 +- - tests/pkcs11/long-label.c | 164 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 168 insertions(+), 3 deletions(-) - create mode 100644 tests/pkcs11/long-label.c - -diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c -index f5e9058e0..64b85a2df 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; -@@ -1172,7 +1173,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 -@@ -1210,7 +1211,7 @@ int gnutls_pkcs11_token_init(const char *token_url, const char *so_pin, - /* 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); -diff --git a/tests/Makefile.am b/tests/Makefile.am -index c8de4494b..f64f7b1c0 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -503,7 +503,7 @@ pathbuf_CPPFLAGS = $(AM_CPPFLAGS) \ - if ENABLE_PKCS11 - if !WINDOWS - ctests += tls13/post-handshake-with-cert-pkcs11 pkcs11/tls-neg-pkcs11-no-key \ -- global-init-override pkcs11/distrust-after -+ global-init-override pkcs11/distrust-after pkcs11/long-label - tls13_post_handshake_with_cert_pkcs11_DEPENDENCIES = libpkcs11mock2.la libutils.la - tls13_post_handshake_with_cert_pkcs11_LDADD = $(LDADD) $(LIBDL) - pkcs11_tls_neg_pkcs11_no_key_DEPENDENCIES = libpkcs11mock2.la libutils.la -diff --git a/tests/pkcs11/long-label.c b/tests/pkcs11/long-label.c -new file mode 100644 -index 000000000..a70bc9728 ---- /dev/null -+++ b/tests/pkcs11/long-label.c -@@ -0,0 +1,164 @@ -+/* -+ * Copyright (C) 2025 Red Hat, Inc. -+ * -+ * Author: Daiki Ueno -+ * -+ * This file is part of GnuTLS. -+ * -+ * GnuTLS is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * GnuTLS is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this program. If not, see <https://www.gnu.org/licenses/> -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include <stdbool.h> -+#include <stdio.h> -+#include <stdlib.h> -+ -+#if defined(_WIN32) -+ -+int main(void) -+{ -+ exit(77); -+} -+ -+#else -+ -+#include <string.h> -+#include <unistd.h> -+#include <gnutls/gnutls.h> -+ -+#include "cert-common.h" -+#include "pkcs11/softhsm.h" -+#include "utils.h" -+ -+/* This program tests that a token can be initialized with -+ * a label longer than 32 characters. -+ */ -+ -+static void tls_log_func(int level, const char *str) -+{ -+ fprintf(stderr, "server|<%d>| %s", level, str); -+} -+ -+#define PIN "1234" -+ -+#define CONFIG_NAME "softhsm-long-label" -+#define CONFIG CONFIG_NAME ".config" -+ -+static int pin_func(void *userdata, int attempt, const char *url, -+ const char *label, unsigned flags, char *pin, -+ size_t pin_max) -+{ -+ if (attempt == 0) { -+ strcpy(pin, PIN); -+ return 0; -+ } -+ return -1; -+} -+ -+static void test(const char *provider) -+{ -+ int ret; -+ size_t i; -+ -+ gnutls_pkcs11_init(GNUTLS_PKCS11_FLAG_MANUAL, NULL); -+ -+ success("test with %s\n", provider); -+ -+ if (debug) { -+ gnutls_global_set_log_function(tls_log_func); -+ gnutls_global_set_log_level(4711); -+ } -+ -+ /* point to SoftHSM token that libpkcs11mock4.so internally uses */ -+ setenv(SOFTHSM_ENV, CONFIG, 1); -+ -+ gnutls_pkcs11_set_pin_function(pin_func, NULL); -+ -+ ret = gnutls_pkcs11_add_provider(provider, "trusted"); -+ if (ret != 0) { -+ fail("gnutls_pkcs11_add_provider: %s\n", gnutls_strerror(ret)); -+ } -+ -+ /* initialize softhsm token */ -+ ret = gnutls_pkcs11_token_init( -+ SOFTHSM_URL, PIN, -+ "this is a very long label whose length exceeds 32"); -+ if (ret < 0) { -+ fail("gnutls_pkcs11_token_init: %s\n", gnutls_strerror(ret)); -+ } -+ -+ for (i = 0;; i++) { -+ char *url = NULL; -+ -+ ret = gnutls_pkcs11_token_get_url(i, 0, &url); -+ if (ret < 0) -+ break; -+ if (strstr(url, -+ "token=this%20is%20a%20very%20long%20label%20whose")) -+ break; -+ } -+ if (ret < 0) -+ fail("gnutls_pkcs11_token_get_url: %s\n", gnutls_strerror(ret)); -+ -+ gnutls_pkcs11_deinit(); -+} -+ -+void doit(void) -+{ -+ const char *bin; -+ const char *lib; -+ char buf[128]; -+ -+ if (gnutls_fips140_mode_enabled()) -+ exit(77); -+ -+ /* this must be called once in the program */ -+ global_init(); -+ -+ /* we call gnutls_pkcs11_init manually */ -+ gnutls_pkcs11_deinit(); -+ -+ /* check if softhsm module is loadable */ -+ lib = softhsm_lib(); -+ -+ /* initialize SoftHSM token that libpkcs11mock4.so internally uses */ -+ bin = softhsm_bin(); -+ -+ set_softhsm_conf(CONFIG); -+ snprintf(buf, sizeof(buf), -+ "%s --init-token --slot 0 --label test --so-pin " PIN -+ " --pin " PIN, -+ bin); -+ system(buf); -+ -+ test(lib); -+ -+ lib = getenv("P11MOCKLIB4"); -+ if (lib == NULL) { -+ fail("P11MOCKLIB4 is not set\n"); -+ } -+ -+ set_softhsm_conf(CONFIG); -+ snprintf(buf, sizeof(buf), -+ "%s --init-token --slot 0 --label test --so-pin " PIN -+ " --pin " PIN, -+ bin); -+ system(buf); -+ -+ test(lib); -+} -+#endif /* _WIN32 */meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +2
-2@@ -21,12 +21,12 @@ SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \ file://arm_eabi.patch \ file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \ + file://0001-audit-crau-fix-compilation-with-gcc-11.patch \ file://run-ptest \ file://Add-ptest-support.patch \ - file://CVE-2025-9820.patch \ " -SRC_URI[sha256sum] = "db7fab7cce791e7727ebbef2334301c821d79a550ec55c9ef096b610b03eb6b7" +SRC_URI[sha256sum] = "91bd23c4a86ebc6152e81303d20cf6ceaeb97bc8f84266d0faec6e29f17baa20" inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest
Signature · 2 lines
Yoann Congal Smile ECS
Hi Yoann,
Sorry for the delayed response — I was on holiday. Thank you for your detailed notes. Please find my comments below:
Quoted 63 lines · Yoann Congal
Quoted 8 lines · Vijay Anusuri via lists.openembedded.org
Release information: [1]
Includes fix for CVE-2025-9820.Refresh patches.
Backport commit to be able to build with gcc<11 (e.g. Debian 11).
[1]
https://lists.gnupg.org/pipermail/gnutls-help/2025-November/004906.html
Quoted 10 lines
Signed-off-by Peter Marko <[email protected]>Signed-off-by Mathieu Dubois-Briand <[email protected]>Signed-off-by Richard Purdie <[email protected]>(From OE-Core rev:
0224dd73d5e462e3ab0958a63d631aa32e330d6c)Dropped CVE-2025-9820.patch
Signed-off-by Vijay Anusuri <[email protected]>Quoted 8 lines
--- ...ile-should-be-excuted-in-target-envi.patch | 2 +- ...dit-crau-fix-compilation-with-gcc-11.patch | 66 +++++ .../gnutls/gnutls/Add-ptest-support.patch | 6 +- .../gnutls/gnutls/CVE-2025-9820.patch | 233 ------------------ .../{gnutls_3.8.10.bb => gnutls_3.8.11.bb} | 4 +- 5 files changed, 72 insertions(+), 239 deletions(-) create mode 100644
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patchQuoted 1 line
delete mode 100644
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patchQuoted 1 line
rename meta/recipes-support/gnutls/{gnutls_3.8.10.bb =>gnutls_3.8.11.bb} (96%)
Hello,
Sorry, but it look like this release mixes enhancement with bugs and CVE fixes:
https://lists.gnupg.org/pipermail/gnutls-help/2025-November/004906.html:Quoted 1 line
Quoted 1 line
As this is the latest branch, I sent the upgrade patch. It looks like
there are some enhancements included apart from the security fixes. I will send a CVE-only patch separately.
Quoted 8 lines
** libgnutls: MAC algorithms for PSK binders is now configurable [...]
** libgnutls: Expose a new function [...]
[...]
** libgnutls: Expose a new function [...]
[...]
** libgnutls: PKCS#11 cryptographic provider configuration takes a tokenURI
Quoted 6 lines
instead of a module path. [...]
[...]
** API and ABI modifications:gnutls_psk_allocate_client_credentials2: New function [...]gnutls_audit_current_context: New function
Quoted 4 lines
I don't think it is suitable for stable inclusion. Same for patch 4/4 of this series.
Quoted 1 line
Quoted 1 line
Understood — I agree that 1/4 and 4/4 may not be suitable for stable
inclusion as they introduce new features or enhancements.
I could take patches 2/4 and 3/4, but do they make sense without 1/4?
Quoted 429 lines
Quoted 2 lines
Quoted 2 lines
I believe 2/4 and 3/4 can be taken independently as 3.8.x supports fips
mode.
Regards,
Quoted 1 line
diff --git
a/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patchb/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patchQuoted 2 lines
index
2dccea7859..0847dde8a9100644
---
a/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patchQuoted 1 line
+++
b/meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patchQuoted 10 lines
meta/recipes-support/gnutls/gnutls/0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch +1
-1@@ -14,7 +14,7 @@ diff --git a/lib/Makefile.am b/lib/Makefile.am index a50d311..193ea19 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am -@@ -272,8 +272,7 @@ hmac_file = .libs/.$(gnutls_so).hmac +@@ -275,8 +275,7 @@ hmac_file = .libs/.$(gnutls_so).hmac all-local: $(hmac_file)diff --git
a/meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patchb/meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patchQuoted 4 lines
new file mode 100644
index 0000000000..60960dad6f
---/dev/null
+++
b/meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patchQuoted 26 lines
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +25
-0@@ -0,0 +1,66 @@ +From 2bbae7644a2292410b53f98fd0035c40bf8750a5 Mon Sep 17 00:00:00 2001 +From: Julien Olivain <[email protected]> +Date: Sun, 23 Nov 2025 18:17:19 +0100 +Subject: [PATCH] audit: crau: fix compilation with gcc < 11 + +If the CRAU_MAYBE_UNUSED macro is unset, the crau.h file tries to +automatically detect an appropriate value for it. + +This autodetection is using the cpp special operator +`__has_c_attribute` [1], introduced in gcc 11 [2]. + +When compiling with a gcc older than version 11, the compilation fails +with the error: + + In file included from audit.h:22, + from audit.c:26: + crau/crau.h:255:23: error: missing binary operator before token "(" + __has_c_attribute (__maybe_unused__) + ^ + +This has been observed, for example, in Rocky Linux 8.10, which +contains a gcc v8.5.0. + +The issue happens because the test for the `__has_c_attribute` +availability and the test for the `__maybe_unused__` attributemeta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch line 35
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +10
-0+are in the same directive. Those tests should be separated in +two different directives, following the same logic described in +the `__has_builtin` documentation [3]. + +This issue was found in Buildroot, after updating gnutls to +version 3.8.11 in [4]. + +This commit fixes the issue by splitting the test in two. + +[1]https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fc_005fattribute.html
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch
Quoted 3 lines
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +3
-0+[2] https://gcc.gnu.org/gcc-11/changes.html#c +[3] https://gcc.gnu.org/onlinedocs/cpp/_005f_005fhas_005fbuiltin.html +[4]https://gitlab.com/buildroot.org/buildroot/-/commit/81dbfe1c2ae848b4eb1f896198d13455df50e548
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch
Quoted 5 lines
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +5
-0+ +Reported-by: Neal Frager <[email protected]> +Signed-off-by: Julien Olivain <[email protected]> + +Upstream-Status: Backport [https://github.com/gnutls/gnutls/commit/2bbae7644a2292410b53f98fd0035c40bf8750a5
]meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +10
-0+Signed-off-by: Peter Marko <[email protected]> +--- + lib/crau/crau.h | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/lib/crau/crau.h b/lib/crau/crau.h +index 0d4f9f13e..53d33555b 100644 +--- a/lib/crau/crau.h ++++ b/lib/crau/crau.h +@@ -251,9 +251,10 @@ void crau_data(struct crau_context_stack_st*stack, ...)
Review
Quoted 14 lines
meta/recipes-support/gnutls/gnutls/0001-audit-crau-fix-compilation-with-gcc-11.patch new file +13
-0+ # else + + # ifndef CRAU_MAYBE_UNUSED +-# if defined(__has_c_attribute) && \ +- __has_c_attribute (__maybe_unused__) +-# define CRAU_MAYBE_UNUSED [[__maybe_unused__]] ++# if defined(__has_c_attribute) ++# if __has_c_attribute (__maybe_unused__) ++# define CRAU_MAYBE_UNUSED [[__maybe_unused__]] ++# endif + # elif defined(__GNUC__) + # define CRAU_MAYBE_UNUSED __attribute__((__unused__)) + # endif(quoted diff) +0
-0
b/meta/recipes-support/gnutls/gnutls/Add-ptest-support.patchmeta/recipes-support/gnutls/gnutls/Add-ptest-support.patch diff --git a/Makefile.am b/Makefile.am · line 20
Quoted 11 lines
index
339d3d2f9e..d8b5035b38100644meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch +1
-1@@ -15,7 +15,7 @@ diff --git a/Makefile.am b/Makefile.am index 843193f..816b09f 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -194,6 +194,9 @@ dist-hook: +@@ -197,6 +197,9 @@ dist-hook: distcheck-hook: @test -d "$(top_srcdir)/po/.reference" || { echo "PO files are notdownloaded; run ./bootstrap without --skip-po"; exit 1; }
Review
Quoted 20 lines
meta/recipes-support/gnutls/gnutls/Add-ptest-support.patch +2
-2@@ -29,7 +29,7 @@ diff --git a/configure.ac b/configure.ac index 1744813..efb9e34 100644 --- a/configure.ac +++ b/configure.ac -@@ -1491,6 +1491,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) +@@ -1447,6 +1447,8 @@ AC_SUBST(LIBGNUTLS_CFLAGS) AM_CONDITIONAL(NEEDS_LIBRT, test "$gnutls_needs_librt" = "yes")@@ -42,7 +42,7 @@ diff --git a/tests/Makefile.am b/tests/Makefile.am index 189d068..8430b05 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -678,6 +678,12 @@ SH_LOG_COMPILER = $(SHELL) +@@ -719,6 +719,12 @@ SH_LOG_COMPILER = $(SHELL) AM_VALGRINDFLAGS = --suppressions=$(srcdir)/suppressions.valgrind LOG_COMPILER = $(LOG_VALGRIND)(quoted diff) +0
-0
b/meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patchQuoted 6 lines
deleted file mode 100644
index e4f97500ee..0000000000meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-1@@ -1,233 +0,0 @@ -From 19ad448d0cc3dd6857b553a47728eead3ea8f445 Mon Sep 17 00:00:00 2001meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch line 11
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-10-From: Daiki Ueno <[email protected]> -Date: Tue, 18 Nov 2025 13:17:55 +0900 -Subject: [PATCH] pkcs11: avoid stack overwrite when initializing a token - -If gnutls_pkcs11_token_init is called with label longer than 32 -characters, the internal storage used to blank-fill it would -overflow. This adds a guard to prevent that. - -CVE: CVE-2025-9820 -Upstream-Status: Backport [https://gitlab.com/gnutls/gnutls/-/commit/1d56f96f6ab5034d677136b9d50b5a75dff0faf5
]Quoted 12 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-12-Signed-off-by: Daiki Ueno <[email protected]> -Signed-off-by: Ankur Tyagi <[email protected]> ---- - lib/pkcs11_write.c | 5 +- - tests/Makefile.am | 2 +- - tests/pkcs11/long-label.c | 164 ++++++++++++++++++++++++++++++++++++++ - 3 files changed, 168 insertions(+), 3 deletions(-) - create mode 100644 tests/pkcs11/long-label.c - -diff --git a/lib/pkcs11_write.c b/lib/pkcs11_write.c -index f5e9058e0..64b85a2df 100644 ---- a/lib/pkcs11_write.cmeta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-10-+++ 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; -@@ -1172,7 +1173,7 @@ int gnutls_pkcs11_delete_url(const char
*object_url, unsigned int flags)meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 9 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-9- * 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 -@@ -1210,7 +1211,7 @@ int gnutls_pkcs11_token_init(const char
*token_url, const char*so_pin,meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 7 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-7- /* 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),meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 9 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-9- (uint8_t *)flabel); -diff --git a/tests/Makefile.am b/tests/Makefile.am -index c8de4494b..f64f7b1c0 100644 ---- a/tests/Makefile.am -+++ b/tests/Makefile.am -@@ -503,7 +503,7 @@ pathbuf_CPPFLAGS = $(AM_CPPFLAGS) \ - if ENABLE_PKCS11 - if !WINDOWS - ctests += tls13/post-handshake-with-cert-pkcs11pkcs11/tls-neg-pkcs11-no-key \
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 3 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-3-- global-init-override pkcs11/distrust-after -+ global-init-override pkcs11/distrust-after pkcs11/long-label - tls13_post_handshake_with_cert_pkcs11_DEPENDENCIES = libpkcs11mock2.lalibutils.la
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch line 63
Quoted 2 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-2- tls13_post_handshake_with_cert_pkcs11_LDADD = $(LDADD) $(LIBDL) - pkcs11_tls_neg_pkcs11_no_key_DEPENDENCIES = libpkcs11mock2.lalibutils.la
Quoted 14 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-14-diff --git a/tests/pkcs11/long-label.c b/tests/pkcs11/long-label.c -new file mode 100644 -index 000000000..a70bc9728 ---- /dev/null -+++ b/tests/pkcs11/long-label.c -@@ -0,0 +1,164 @@ -+/* -+ * Copyright (C) 2025 Red Hat, Inc. -+ * -+ * Author: Daiki Ueno -+ * -+ * This file is part of GnuTLS. -+ * -+ * GnuTLS is free software; you can redistribute it and/or modify itmeta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-10-+ * under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 3 of the License, or -+ * (at your option) any later version. -+ * -+ * GnuTLS is distributed in the hope that it will be useful, but -+ * WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General PublicLicense
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch line 88
Quoted 1 line
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-1-+ * along with this program. If not, see <Quoted 64 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-64-+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+ -+#include <stdbool.h> -+#include <stdio.h> -+#include <stdlib.h> -+ -+#if defined(_WIN32) -+ -+int main(void) -+{ -+ exit(77); -+} -+ -+#else -+ -+#include <string.h> -+#include <unistd.h> -+#include <gnutls/gnutls.h> -+ -+#include "cert-common.h" -+#include "pkcs11/softhsm.h" -+#include "utils.h" -+ -+/* This program tests that a token can be initialized with -+ * a label longer than 32 characters. -+ */ -+ -+static void tls_log_func(int level, const char *str) -+{ -+ fprintf(stderr, "server|<%d>| %s", level, str); -+} -+ -+#define PIN "1234" -+ -+#define CONFIG_NAME "softhsm-long-label" -+#define CONFIG CONFIG_NAME ".config" -+ -+static int pin_func(void *userdata, int attempt, const char *url, -+ const char *label, unsigned flags, char *pin, -+ size_t pin_max) -+{ -+ if (attempt == 0) { -+ strcpy(pin, PIN); -+ return 0; -+ } -+ return -1; -+} -+ -+static void test(const char *provider) -+{ -+ int ret; -+ size_t i; -+ -+ gnutls_pkcs11_init(GNUTLS_PKCS11_FLAG_MANUAL, NULL); -+ -+ success("test with %s\n", provider); -+ -+ if (debug) { -+ gnutls_global_set_log_function(tls_log_func); -+ gnutls_global_set_log_level(4711);meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-10-+ } -+ -+ /* point to SoftHSM token that libpkcs11mock4.so internally uses */ -+ setenv(SOFTHSM_ENV, CONFIG, 1); -+ -+ gnutls_pkcs11_set_pin_function(pin_func, NULL); -+ -+ ret = gnutls_pkcs11_add_provider(provider, "trusted"); -+ if (ret != 0) { -+ fail("gnutls_pkcs11_add_provider: %s\n",
gnutls_strerror(ret));meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 8 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-8-+ } -+ -+ /* initialize softhsm token */ -+ ret = gnutls_pkcs11_token_init( -+ SOFTHSM_URL, PIN, -+ "this is a very long label whose length exceeds 32"); -+ if (ret < 0) { -+ fail("gnutls_pkcs11_token_init: %s\n",
gnutls_strerror(ret));meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch line 185
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-10-+ } -+ -+ for (i = 0;; i++) { -+ char *url = NULL; -+ -+ ret = gnutls_pkcs11_token_get_url(i, 0, &url); -+ if (ret < 0) -+ break; -+ if (strstr(url, -+"token=this%20is%20a%20very%20long%20label%20whose"))
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 4 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-4-+ break; -+ } -+ if (ret < 0) -+ fail("gnutls_pkcs11_token_get_url: %s\n",
gnutls_strerror(ret));Quoted 13 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-13-+ -+ gnutls_pkcs11_deinit(); -+} -+ -+void doit(void) -+{ -+ const char *bin; -+ const char *lib; -+ char buf[128]; -+ -+ if (gnutls_fips140_mode_enabled()) -+ exit(77); -+meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch
Quoted 10 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-10-+ /* this must be called once in the program */ -+ global_init(); -+ -+ /* we call gnutls_pkcs11_init manually */ -+ gnutls_pkcs11_deinit(); -+ -+ /* check if softhsm module is loadable */ -+ lib = softhsm_lib(); -+ -+ /* initialize SoftHSM token that libpkcs11mock4.so internally uses*/
Review
Quoted 27 lines
meta/recipes-support/gnutls/gnutls/CVE-2025-9820.patch deleted +0
-26-+ bin = softhsm_bin(); -+ -+ set_softhsm_conf(CONFIG); -+ snprintf(buf, sizeof(buf), -+ "%s --init-token --slot 0 --label test --so-pin " PIN -+ " --pin " PIN, -+ bin); -+ system(buf); -+ -+ test(lib); -+ -+ lib = getenv("P11MOCKLIB4"); -+ if (lib == NULL) { -+ fail("P11MOCKLIB4 is not set\n"); -+ } -+ -+ set_softhsm_conf(CONFIG); -+ snprintf(buf, sizeof(buf), -+ "%s --init-token --slot 0 --label test --so-pin " PIN -+ " --pin " PIN, -+ bin); -+ system(buf); -+ -+ test(lib); -+} -+#endif /* _WIN32 */(quoted diff) +0
-0b/meta/recipes-support/gnutls/gnutls_3.8.11.bb
meta/recipes-support/gnutls/gnutls_3.8.11.bb SHRT_VER =
Quoted 7 lines
similarity index 96%
rename from meta/recipes-support/gnutls/gnutls_3.8.10.bb rename to meta/recipes-support/gnutls/gnutls_3.8.11.bb indexb07c166c0e..faeb1a4ede100644meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +0
-0@@ -21,12 +21,12 @@ SHRT_VER ="${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
meta/recipes-support/gnutls/gnutls_3.8.11.bb SHRT_VER = · line 21
Quoted 1 line
meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +0
-0SRC_URI = "https://www.gnupg.org/ftp/gcrypt/gnutls/v${SHRT_VER}/gnutls-${PV}.tar.xz \
meta/recipes-support/gnutls/gnutls_3.8.11.bb SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" · line 28
Quoted 2 lines
meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +0
-0file://arm_eabi.patch \file://0001-Creating-.hmac-file-should-be-excuted-in-target-envi.patch \
meta/recipes-support/gnutls/gnutls_3.8.11.bb SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}"
Quoted 7 lines
meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +1
-2+ file://0001-audit-crau-fix-compilation-with-gcc-11.patch \ file://run-ptest \ file://Add-ptest-support.patch \ - file://CVE-2025-9820.patch \ " -SRC_URI[sha256sum] ="
db7fab7cce791e7727ebbef2334301c821d79a550ec55c9ef096b610b03eb6b7"meta/recipes-support/gnutls/gnutls_3.8.11.bb SHRT_VER = · line 29
Quoted 1 line
meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +1
-0+SRC_URI[sha256sum] ="
91bd23c4a86ebc6152e81303d20cf6ceaeb97bc8f84266d0faec6e29f17baa20"meta/recipes-support/gnutls/gnutls_3.8.11.bb SHRT_VER = "${@d.getVar('PV').split('.')[0]}.${@d.getVar('PV').split('.')[1]}" · line 32
Quoted 3 lines
meta/recipes-support/gnutls/gnutls_3.8.11.bb renamed from meta/recipes-support/gnutls/gnutls_3.8.10.bb +0
-0inherit autotools texinfo pkgconfig gettext lib_package gtk-doc ptest--
Yoann Congal
Smile ECSThanks & Regrds,
Vijay