]> git.ipfire.org Git - thirdparty/openssl.git/commit
crypto/mem.c: check the alignment for being a power of 2 in CRYPTO_aligned_alloc
authorEugene Syromiatnikov <esyr@openssl.org>
Thu, 31 Jul 2025 12:27:22 +0000 (14:27 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 8 Aug 2025 16:22:10 +0000 (12:22 -0400)
commit1104e80c8dff7d04eb482ddc315947268c251384
tree5929f54bc36061dd0cb2ab4075ad4ad149ac3a3a
parent648803a17e4c1511ebc90a78542d0e649b6eb318
crypto/mem.c: check the alignment for being a power of 2 in CRYPTO_aligned_alloc

Otherwise the roundup calculation performed in the open-coded implementation
may put the pointer out of bounds.

Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28059)
crypto/mem.c
include/internal/mem_alloc_utils.h