aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrainerjung <[email protected]>2026-10-13 12:11:05 +0200
committerTomas Mraz <[email protected]>2026-10-21 19:09:29 +0200
commitf48b4e3b74a5f08e104f2d13e8a85d6a690c69a7 (patch)
tree6f6a9ba3c51acb29e227972888cbe7b2d4b2af2a
parentCI: retry environment steps before failing the job (diff)
downloadopenssl-f48b4e3b74a5f08e104f2d13e8a85d6a690c69a7.tar.gz
openssl-f48b4e3b74a5f08e104f2d13e8a85d6a690c69a7.zip
Fix wrong alignment in tho allocator used in quic_stream test.
Wrong alignment observed on Solaris Sparc 10 (bus error). THO_ALLOC_HDR has size 20 and memory for structures gets allocated at addresses directly following a THO_ALLOC_HDR. Backport needed for the 4.1 branch. Fixes https://github.com/openssl/openssl/issues/33187 Reviewed-by: Eugene Syromiatnikov <[email protected]> Reviewed-by: Nikola Pajkovsky <[email protected]> Merge-date: Wed Oct 21 17:10:20 2026 Merged-from: https://github.com/openssl/openssl/pull/33204
-rw-r--r--test/quic_stream_test.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/quic_stream_test.c b/test/quic_stream_test.c
index dbb666973d0..1da50a3ee53 100644
--- a/test/quic_stream_test.c
+++ b/test/quic_stream_test.c
@@ -2870,7 +2870,17 @@ static CRYPTO_malloc_fn malloc_save;
static CRYPTO_realloc_fn realloc_save;
static CRYPTO_free_fn free_save;
-typedef struct tdc_alloc_hdr_st {
+#if defined(__GNUC__) || defined(__clang__)
+#define ALIGN_ALLOC_HDR __attribute((aligned(16)))
+#else
+#define ALIGN_ALLOC_HDR
+#endif
+
+/*
+ * Increased alignment is needed, as tdc_malloc() custom allocator
+ * returns memory addresses directly following a TDC_ALLOC_HDR.
+ */
+typedef struct ALIGN_ALLOC_HDR tdc_alloc_hdr_st {
size_t size;
OSSL_LIST_MEMBER(tdc, struct tdc_alloc_hdr_st);
} TDC_ALLOC_HDR;
@@ -3156,7 +3166,11 @@ err:
return ok;
}
-typedef struct tho_alloc_hdr_st {
+/*
+ * Increased alignment is needed, as tho_malloc() custom allocator
+ * returns memory addresses directly following a THO_ALLOC_HDR.
+ */
+typedef struct ALIGN_ALLOC_HDR tho_alloc_hdr_st {
size_t size;
const char *file;
int from_reas;