[openssl/openssl] 2c7cae: Convert hashtable to using ossl_rcu_deref on lookup

Neil Horman noreply at github.com
Wed Jul 3 07:09:55 UTC 2024


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 2c7cae53bc61f40baff70af0495cf3d976ed7d14
      https://github.com/openssl/openssl/commit/2c7cae53bc61f40baff70af0495cf3d976ed7d14
  Author: Neil Horman <nhorman at openssl.org>
  Date:   2024-07-03 (Wed, 03 Jul 2024)

  Changed paths:
    M crypto/hashtable/hashtable.c

  Log Message:
  -----------
  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 at gmail.com>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24682)



To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications


More information about the openssl-commits mailing list