]> git.ipfire.org Git - thirdparty/openssl.git/commit
Add locking to atomic operations in rw/rcu tests
authorNeil Horman <nhorman@openssl.org>
Fri, 29 Mar 2024 15:39:12 +0000 (11:39 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 2 Apr 2024 08:12:16 +0000 (04:12 -0400)
commit5f8b812931e5da24df08913c05ff8e4f4494f014
tree808edabc121afb1cbf50fd3d278877b34521d6b5
parent81f2b0420abab47a7fd9fc9ef69309578115d342
Add locking to atomic operations in rw/rcu tests

I neglected to add locks to the calls to CRYPTO_atomic_add in these
test, which on newer compilers is fine, as atomic operations are
defined.  However on older compilers the __ATOMIC_ACQ_REL definition is
missing causing these function to be implemented using an rwlock, which
when NULL causes the locks to fail.

Fix this my creating the lock and using them appropriately

Fixes #24000

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/24001)
test/threadstest.c