]> git.ipfire.org Git - thirdparty/openssl.git/commit
Explicitly limit the OPENSSL_aligned_alloc()'s alignment to 65536
authorEugene Syromiatnikov <esyr@openssl.org>
Thu, 28 Aug 2025 14:43:13 +0000 (16:43 +0200)
committerNeil Horman <nhorman@openssl.org>
Tue, 16 Sep 2025 13:59:13 +0000 (09:59 -0400)
commit6c02774fd33d3a65dfcfabfc01778afb48070461
tree0bc5f04b6813fb6eeb3b9e436022ced4f8be43be
parentf75a6d951a95d6eea68b5ec6ca564fc8edaf1d14
Explicitly limit the OPENSSL_aligned_alloc()'s alignment to 65536

There is little need to support alignments larger than a page size,
and the open-coded OPENSSL_aligned_alloc() implementation implements
that support in quite wasteful manner, so it is better just to limit
the maximum supported alignment explicitly.  The value of 65536
has been chosen so it is architecture-agnostic and is no less than page sizes
used in commonly occurring architectures (and also it is a pretty number).

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28295)
crypto/aligned_alloc.c
crypto/mem.c
doc/man3/OPENSSL_malloc.pod
test/mem_alloc_test.c