]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix memory ordering guarantees and TSAN errors
authorTomas Mraz <tomas@openssl.org>
Thu, 17 Oct 2024 09:25:17 +0000 (11:25 +0200)
committerTomas Mraz <tomas@openssl.org>
Tue, 10 Dec 2024 13:58:08 +0000 (14:58 +0100)
commit3bf273b21b3e21cca9cd143ed9016397bd7dbb57
treef91d090a0334458f4b6a106b8f2ff28397e3fde9
parent420d5d6294449527f4dd986b4fed8681bd4ae8fb
Fix memory ordering guarantees and TSAN errors

If we had refcounted object allowing lockless writes
the relaxed semantics on DOWN_REF would allow scheduling
these writes after simultaneous release of the object by
another thread.

We do not have any such objects yet, but better to make
the refcount correct just in case we will have them
in future.

TSAN doesn't properly understand this so we use
even stronger acq_rel semantics if building with TSAN.

Fixes #25660

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25664)
include/internal/refcount.h