]> git.ipfire.org Git - thirdparty/openssl.git/commit
Convert hashtable to using ossl_rcu_deref on lookup
authorNeil Horman <nhorman@openssl.org>
Wed, 19 Jun 2024 21:53:58 +0000 (17:53 -0400)
committerTomas Mraz <tomas@openssl.org>
Wed, 3 Jul 2024 07:07:21 +0000 (09:07 +0200)
commit2c7cae53bc61f40baff70af0495cf3d976ed7d14
treec7b24a678a37d29870217e368f318ab93cd432b6
parentb1e7bc5bdfc73ef841afa30ac321975b0d63219a
Convert hashtable to using ossl_rcu_deref on lookup

The new hashtable has an issue on non-64 bit builds.  We use
CRYPTO_atomic_load to load a pointer value when doing lookups, but that
API relies on the expectation that pointers are 64 bits wide.  On 32 bit
systems, we try to load 64 bits using CRYPTO_atomic_load into a 32 bit
pointer, which overruns our stack

Fix this by no longer using CRYPTO_atomic_load for value fetches from
the hashtable.  Instead use ossl_rcu_deref, whcih operates on void
pointers and is safe on all arches

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24682)
crypto/hashtable/hashtable.c