[packages/mbedtls] add workaround for recurring gcc array bounds checker bugs; rel 2

atler atler at pld-linux.org
Wed Jul 29 23:35:51 CEST 2026


commit 31ccedb631691f4abf8b28b43f10a9716680f1c5
Author: Jan Palus <atler at pld-linux.org>
Date:   Wed Jul 29 23:30:14 2026 +0200

    add workaround for recurring gcc array bounds checker bugs; rel 2
    
    first observed with gcc 14:
    
    https://github.com/Mbed-TLS/mbedtls/issues/9003
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121044
    
    now came back with gcc 15.3.0 (15.2.0 is ok) in different incarnation
    affecting 32-bit archs this time. I finally gave up on trying to
    create minimal reproducer.

 array-bounds.patch | 11 +++++++++++
 mbedtls.spec       |  4 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/mbedtls.spec b/mbedtls.spec
index e1e0b00..e1e9424 100644
--- a/mbedtls.spec
+++ b/mbedtls.spec
@@ -10,13 +10,14 @@ Summary:	Light-weight cryptographic and SSL/TLS library
 Summary(pl.UTF-8):	Lekka biblioteka kryptograficzna oraz SSL/TLS
 Name:		mbedtls
 Version:	3.6.7
-Release:	1
+Release:	2
 License:	GPL v2+
 Group:		Libraries
 #Source0Download: https://github.com/Mbed-TLS/mbedtls/releases
 Source0:	https://github.com/Mbed-TLS/mbedtls/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
 # Source0-md5:	d207524bd8f9dfb5fbf7f4a1997e636f
 Patch0:		%{name}-config-dtls-srtp.patch
+Patch1:		array-bounds.patch
 URL:		https://www.trustedfirmware.org/projects/mbed-tls/
 BuildRequires:	cmake >= 3.5.1
 BuildRequires:	doxygen
@@ -82,6 +83,7 @@ Dokumentacja API biblioteki mbedTLS.
 %prep
 %setup -q
 %patch -P0 -p1
+%patch -P1 -p1
 
 %build
 %if %{with x86aes}
diff --git a/array-bounds.patch b/array-bounds.patch
new file mode 100644
index 0000000..09e20fe
--- /dev/null
+++ b/array-bounds.patch
@@ -0,0 +1,11 @@
+--- mbedtls-3.6.7/library/common.h.orig	2026-07-02 17:37:17.059929800 +0200
++++ mbedtls-3.6.7/library/common.h	2026-07-29 23:25:53.513309075 +0200
+@@ -332,7 +332,7 @@
+         uint32_t x = mbedtls_get_unaligned_uint32(a + i) ^ mbedtls_get_unaligned_uint32(b + i);
+         mbedtls_put_unaligned_uint32(r + i, x);
+     }
+-#if defined(__IAR_SYSTEMS_ICC__)
++#if defined(__IAR_SYSTEMS_ICC__) || defined(MBEDTLS_COMPILER_IS_GCC)
+     if (n % 4 == 0) {
+         return;
+     }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mbedtls.git/commitdiff/31ccedb631691f4abf8b28b43f10a9716680f1c5



More information about the pld-cvs-commit mailing list