Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27961)
Run-checker CI / run-checker (enable-trace enable-fips) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-cmp) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-cms) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-default-thread-pool) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-dgram) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-dh) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-dtls) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-ec) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-ecx) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-http) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-legacy) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-ml-dsa) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-ml-kem) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-quic) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-sock) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-ssl-trace) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-stdio) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-thread-pool) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-threads) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-tls) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-tls1_2) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-tls1_3) (push) Has been cancelledDetails
Run-checker CI / run-checker (no-ui) (push) Has been cancelledDetails
Run-checker merge / run-checker (enable-asan enable-ubsan no-shared no-asm -DOPENSSL_SMALL_FOOTPRINT -fno-sanitize=function) (push) Has been cancelledDetails
Run-checker merge / run-checker (enable-pie) (push) Has been cancelledDetails
Run-checker merge / run-checker (enable-ubsan no-asm -DOPENSSL_SMALL_FOOTPRINT -fno-sanitize=function) (push) Has been cancelledDetails
Run-checker merge / run-checker (enable-weak-ssl-ciphers) (push) Has been cancelledDetails
Run-checker merge / run-checker (enable-zlib) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-dso) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-dynamic-engine) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-ec2m enable-fips) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-engine no-shared) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-err) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-filenames) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-integrity-only-ciphers) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-module) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-ocsp) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-pinshared) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-srp) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-srtp) (push) Has been cancelledDetails
Run-checker merge / run-checker (no-ts) (push) Has been cancelledDetails
Run-checker merge / jitter (push) Has been cancelledDetails
Run-checker merge / threads_sanitizer_atomic_fallback (push) Has been cancelledDetails
Windows GitHub CI / shared (map[arch:win32 config:--strict-warnings enable-lms no-fips os:windows-2025]) (push) Has been cancelledDetails
Windows GitHub CI / shared (map[arch:win64 config:enable-lms enable-fips no-thread-pool no-quic os:windows-2025]) (push) Has been cancelledDetails
Windows GitHub CI / shared (map[arch:win64 config:enable-lms enable-fips os:windows-2022]) (push) Has been cancelledDetails
Windows GitHub CI / plain (windows-2022) (push) Has been cancelledDetails
Windows GitHub CI / minimal (windows-2022) (push) Has been cancelledDetails
Windows GitHub CI / cygwin (windows-2022, map[arch:win64 config:-DCMAKE_C_COMPILER=gcc --strict-warnings enable-demos no-fips]) (push) Has been cancelledDetails
Windows Compression GitHub CI / zstd (push) Has been cancelledDetails
Windows Compression GitHub CI / brotli (push) Has been cancelledDetails
Something we're missing in our ability to do performance monitoring
and diagnosis in openssl is the ability to check for lock contention.
While some tools exist for this (valgrinds drd tool for example), they
really only measure the time spent in critical sections, not the
instances in which they are contended. For that we need something more
specific.
This patch introduces the REPORT_RWLOCK_CONTENTION macro. When openssl
is built with:
./Configure -rdynamic -fno-omit-frame-pointer -DREPORT_RWLOCK_CONTENTION
We can now get output sent to a log file that looks like the following:
===============
lock blocked on WRITE for 1001 usec
/lib64/libasan.so.8(+0x525e7) [0x7fc5ef4525e7]
../../test/quic_radix_test(CRYPTO_THREAD_write_lock+0x151) [0x79d976]
../../test/quic_radix_test() [0x61e6fb]
../../test/quic_radix_test(test_vprintf_stderr+0x15) [0x61e78d]
../../test/quic_radix_test(test_printf_stderr+0x10f) [0x623ba4]
../../test/quic_radix_test(test_fail_message_prefix+0xf7) [0x62436b]
../../test/quic_radix_test() [0x6243b9]
../../test/quic_radix_test(test_info+0x133) [0x624842]
../../test/quic_radix_test() [0x415aad]
../../test/quic_radix_test() [0x417bad]
../../test/quic_radix_test() [0x41b1a9]
../../test/quic_radix_test() [0x41b2eb]
../../test/quic_radix_test() [0x8071fc]
/lib64/libasan.so.8(+0x28ee6) [0x7fc5ef428ee6]
/lib64/libc.so.6(+0x711d4) [0x7fc5ef27f1d4]
/lib64/libc.so.6(+0xf3cec) [0x7fc5ef301cec]
==============
Which tells us when a thread blocked because someone else was already
holding the lock, how long it was blocked for, and where the blocking
call originated from via its backtrace.
I think this should enable us to better determine where our contended
locking paths are for a given application, and give us some insight on
how to fix them.
Currently its linux only (as the backtrace functionality only exists
there, and there are few warts (like the need to use a file pointer
rather than a bio to record the log, see comments), but I think its
enough to give us a useful diagnostic tool to help drive some
performance improvements.
Fixesopenssl/project#1237
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27884)
RCU stores a per-thread local structure per context-thread, making it
necessecary to move them to the new api to avoid exhausting our OS level
thread-local storage resources when creating lots of contexts
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27794)
We should never fail to obtain a lock, so assert that we are successful
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27408)
Only a minimum of 2 qp's are necessary: one for the readers,
and at least one that writers can wait on for retirement.
There is no need for one additional qp that is always unused.
Also only one ACQUIRE barrier is necessary in get_hold_current_qp,
so the ATOMIC_LOAD of the reader_idx can be changed to RELAXED.
And finally clarify some comments.
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/27012)
Run-checker daily / run-checker (-DOPENSSL_TLS_SECURITY_LEVEL=0) (push) Has been cancelledDetails
Run-checker daily / run-checker (-DSSL3_ALIGN_PAYLOAD=4) (push) Has been cancelledDetails
Run-checker daily / run-checker (386) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-crypto-mdebug) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-crypto-mdebug-backtrace) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-demos) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-ec_nistp_64_gcc_128) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-egd) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-fips enable-acvp-tests) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-fips no-des no-dsa no-ec2m) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-fips no-tls1_3) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-fips) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-h3demo) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-heartbeats) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-hqinterop) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-md2) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-rc5) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-ssl3) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-ssl3-method) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-sslkeylog) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-tfo) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-trace) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-unit-test) (push) Has been cancelledDetails
Run-checker daily / run-checker (enable-zlib-dynamic) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-afalgeng) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-apps) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-aria) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-asan) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-asm) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-async) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-atexit) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-autoalginit) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-autoerrinit) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-autoload-config) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-bf) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-blake2) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-buildtest-c++) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-bulk) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-cached-fetch) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-camellia) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-capieng) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-cast) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-chacha) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-cmac) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-comp) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ct) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-deprecated) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-des) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-docs) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-dsa) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-dtls1) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-dtls1-method) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-dtls1_2) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-dtls1_2-method) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ecdh) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ecdsa) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-engine) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-gost) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-hw) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-hw-padlock) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-idea) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-makedepend) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-md4) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-mdc2) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-msan) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-multiblock) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-nextprotoneg) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ocb) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-padlockeng) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-pic) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-poly1305) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-posix-io) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-psk) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-rc2) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-rdrand) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-rfc3779) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ripemd) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-rmd160) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-scrypt) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-secure-memory) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-seed) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-shared) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-siphash) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-siv) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-sm2) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-sm2-precomp) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-sm3) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-sm4) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-sock) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-sse2) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ssl) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-static-engine no-shared) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-tests) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-tls1) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-tls1-method) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-tls1_1) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-tls1_1-method) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-tls1_2-method) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ubsan) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-ui-console) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-uplink) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-weak-ssl-ciphers) (push) Has been cancelledDetails
Run-checker daily / run-checker (no-whirlpool) (push) Has been cancelledDetails
Run-checker daily / run-checker-sctp (push) Has been cancelledDetails
Run-checker daily / enable_brotli_dynamic (push) Has been cancelledDetails
Run-checker daily / enable_zstd_dynamic (push) Has been cancelledDetails
Run-checker daily / enable_brotli_and_zstd_dynamic (push) Has been cancelledDetails
Run-checker daily / enable_brotli_and_asan_ubsan (push) Has been cancelledDetails
Run-checker daily / enable_zstd_and_asan_ubsan (push) Has been cancelledDetails
Run-checker daily / enable_tfo (macos-13) (push) Has been cancelledDetails
Run-checker daily / enable_tfo (macos-14) (push) Has been cancelledDetails
Run-checker daily / enable_tfo (ubuntu-latest) (push) Has been cancelledDetails
Run-checker daily / enable_buildtest (push) Has been cancelledDetails
Run-checker daily / memory_sanitizer_slh_dsa (push) Has been cancelledDetails
Build openssl interop container from master / update_quay_container (push) Has been cancelledDetails
OS Zoo CI / alpine (clang, edge) (push) Has been cancelledDetails
OS Zoo CI / alpine (clang, latest) (push) Has been cancelledDetails
OS Zoo CI / alpine (gcc, edge) (push) Has been cancelledDetails
OS Zoo CI / alpine (gcc, latest) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/centos:8 install:sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* && \
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* && \
dnf install -y gcc make… (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/debian:10 install:apt-get update && apt-get install -y gcc make perl]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/debian:11 install:apt-get update && apt-get install -y gcc make perl]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/debian:12 install:apt-get update && apt-get install -y gcc make perl]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/fedora:38 install:dnf install -y gcc make perl-core]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/fedora:39 install:dnf install -y gcc make perl-core]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/rockylinux:8 install:dnf install -y gcc make perl-core]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/rockylinux:9 install:dnf install -y gcc make perl-core]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/ubuntu:20.04 install:apt-get update && apt-get install -y gcc make perl]) (push) Has been cancelledDetails
OS Zoo CI / linux (map[image:docker.io/library/ubuntu:22.04 install:apt-get update && apt-get install -y gcc make perl]) (push) Has been cancelledDetails
OS Zoo CI / macos (macos-13) (push) Has been cancelledDetails
OS Zoo CI / macos (macos-14) (push) Has been cancelledDetails
OS Zoo CI / macos (macos-15) (push) Has been cancelledDetails
OS Zoo CI / windows (windows-2019) (push) Has been cancelledDetails
OS Zoo CI / windows (windows-2022) (push) Has been cancelledDetails
OS Zoo CI / linux-arm64 (push) Has been cancelledDetails
OS Zoo CI / linux-ppc64le (push) Has been cancelledDetails
OS Zoo CI / linux-s390x (push) Has been cancelledDetails
OS Zoo CI / freebsd-x86_64 (push) Has been cancelledDetails
Interoperability tests with GnuTLS and NSS / test (gnutls) (push) Has been cancelledDetails
Interoperability tests with GnuTLS and NSS / test (nss) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.0, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.0, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.0, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.0, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.0, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.0, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.1, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.1, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.1, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.1, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.1, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.1, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.2, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.2, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.2, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.2, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.2, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.2, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.3, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.3, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.3, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.3, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.3, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.3, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.4, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.4, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.4, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.4, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.4, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-3.4, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-master, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-master, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-master, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-master, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-master, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (branch-master, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.0, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.0, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.0, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.0, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.0, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.0, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.8, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.8, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.8, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.8, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.8, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.8, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.9, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.9, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.9, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.9, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.9, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.0.9, branch-master) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.1.2, branch-3.0) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.1.2, branch-3.1) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.1.2, branch-3.2) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.1.2, branch-3.3) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.1.2, branch-3.4) (push) Has been cancelledDetails
Provider compatibility across versions / cross-testing (openssl-3.1.2, branch-master) (push) Has been cancelledDetails
this adds a dummy atomic release operation to update_qp, which
should make sure that the new value of reader_idx is visible in
get_hold_current_qp, directly after incrementing the users count.
Fixes: #26875
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26964)
- Update allocate_new_qp_group to take unsigned int
- Move id_ctr in rcu_lock_st for better stack alignment
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26972)
The current retirement code for rcu qp's has a race condition,
which can cause use-after-free errors, but only if more than
3 QPs are allocated, which is not the default configuration.
This fixes an oversight in commit 5949918f9a ("Rework and
simplify RCU code")
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26952)
This reverts #23974 which seems to be no longer needed now,
due to other fixes nearby. Most likely the change did just
slightly decrease the performance of the reader threads, and
did therefore create the wrong impression that it fixed the issue.
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26881)
as the other CRYPTO_atomic_X functions.
All CRYPTO_atomic functions should use the same logic here,
just in case...
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26815)
the unused atomic stub functions make clang issue
unused function warnings -Wunused-function
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26815)
Older compilers don't always support __ATOMIC_ACQ_REL, use a lock where
they don't
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/26747)
Use __ATOMIC_RELAXED where possible.
Dont store additional values in the users field.
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26690)
ppc64le occasionally still fails the threadstest on __rcu_torture
From several days of debugging, I think I've landed on the problem.
Occasionally, under high load I observe the following pattern
CPU0 CPU1
update_qp get_hold_current_qp
atomic_and_fetch(qp->users, ID_MASK, RELEASE)
atomic_add_fetch(qp->users, 1, RELEASE
atomic_or_fetch(qp->users, ID_VAL++, RELEASE)
When this pattern occurs, the atomic or operation fails to see the published
value of CPU1 and when the or-ed value is written back to ram, the incremented
value in get_hold_current_qp is overwritten, meaning the hold that the reader
placed on the rcu lock is lost, allowing the writer to complete early, freeing
memory before a reader is done reading any held memory.
Why this is only observed on ppc64le I'm not sure, but it seems like a pretty
clear problem.
fix it by implementing ATOMIC_COMPARE_EXCHANGE_N, so that, on the write side in
update_qp, we can ensure that updates are only done if the read side hasn't
changed anything. If it has, retry the operation.
With this fix, I'm able to run the threads test overnight (4000 iterations and
counting) without failure.
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26478)
An intermittent failure was noted on our new ppc64le CI runner, in which
what appeared to be a corrupted or invalid value getting returned from a
shared pointer under rcu protection
Investigation showed that the problem was with our small number of qp's
in a lock, and slightly incorrect accounting of the number of qp's
available we were prematurely recycling qp's, which led in turn to
premature completion of synchronization states, resulting in readers
reading memory that may have already been freed.
Fix it by:
a) Ensuring that we account for the fact that the first qp in an rcu
lock is allocated at the time the lock is created
and
b) Ensuring that we have a minimum number of 3 qp's:
1 that is free for write side allocation
1 that is in use by the write side currently
1 "next" qp that the read side can update while the prior qp is being
retired
With this change, the rcu threadstest runs indefinately in my testing
Fixes#26356
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26384)
We just avoid the special handling needed for Apple M1.
Fixes#26135
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/26145)
Misnamed variable, just correct it to dst
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26075)
Adjust long lines and correct padding in preprocessor lines to
match the formatting rules
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24941)
It appears nonstops new threading model defines some level of rwlock
pthread api, but its not working properly. Disable rwlocks for
_KLT_MODEL_ for now
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/24969)
If the implementation of this function falls to using a pthread lock to
update a value, it should be a write lock, not a read lock
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/24969)
Improve code consistency between threads_pthread.c and threads_win.c
threads_pthread.c has good comments, let's copy them to threads_win.c
In many places uint64_t or LONG int was used, and assignments were
performed between variables with different sizes.
Unify the code to use uint32_t. In 32 bit architectures it is easier
to perform 32 bit atomic operations. The size is large enough to hold
the list of operations.
Fix result of atomic_or_uint_nv improperly casted to int *
instead of int.
Note:
In general size_t should be preferred for size and index, due to its
descriptive name, however it is more convenient to use uint32_t for
consistency between platforms and atomic calls.
READER_COUNT and ID_VAL return results that fit 32 bit. Cast them to
uint32_t to save a few CPU cycles, since they are used in 32 bit
operations anyway.
TODO:
In struct rcu_lock_st, qp_group can be moved before id_ctr
for better alignment, which would save 8 bytes.
allocate_new_qp_group has a parameter count of type int.
Signed values should be avoided as size or index.
It is better to use unsigned, e.g uint32_t, even though
internally this is assigned to a uint32_t variable.
READER_SIZE is 16 in threads_pthread.c, and 32 in threads_win.c
Using a common size for consistency should be prefered.
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24803)
InterlockedAnd64 and InterlockedAdd64 are not available on VS2010 x86.
We already have implemented replacements for other functions, such as
InterlockedOr64. Apply the same approach to fix the errors.
A CRYPTO_RWLOCK rw_lock is added to rcu_lock_st.
Replace InterlockedOr64 and InterlockedOr with CRYPTO_atomic_load and
CRYPTO_atomic_load_int, using the existing design pattern.
Add documentation and tests for the new atomic functions
CRYPTO_atomic_add64, CRYPTO_atomic_and
Fixes:
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedAdd64 referenced in function _get_hold_current_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedOr referenced in function _get_hold_current_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedAnd64 referenced in function _update_qp
libcrypto.lib(libcrypto-lib-threads_win.obj) : error LNK2019: unresolved external symbol _InterlockedOr64 referenced in function _ossl_synchronize_rcu
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24405)
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24630)
(cherry picked from commit d38d264228)
Generally we can get away with just using CRYPTO_atomic_load to do
stores by reversing the source and target variables, but doing so
creates a problem for the thread sanitizer as CRYPTO_atomic_load hard
codes an __ATOMIC_ACQUIRE constraint, which confuses tsan into thinking
that loads and stores aren't properly ordered, leading to RAW/WAR
hazzards getting reported. Instead create a CRYPTO_atomic_store api
that is identical to the load variant, save for the fact that the value
is a unit64_t rather than a pointer that gets stored using an
__ATOMIC_RELEASE constraint, satisfying tsan.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23671)
The ossl_rcu_call function for windows creates a linked list loop. fix
it to work like the pthread version properly
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23671)
This is unfortunate, but seems necessecary
tsan in gcc/clang tracks data races by recording memory references made
while various locks are held. If it finds that a given address is
read/written while under lock (or under no locks without the use of
atomics), it issues a warning
this creates a specific problem for rcu, because on the write side of a
critical section, we write data under the protection of a lock, but by
definition the read side has no lock, and so rcu warns us about it,
which is really a false positive, because we know that, even if a
pointer changes its value, the data it points to will be valid.
The best way to fix it, short of implementing tsan hooks for rcu locks
in any thread sanitizer in the field, is to 'fake it'. If thread
sanitization is activated, then in ossl_rcu_write_[lock|unlock] we add
annotations to make the sanitizer think that, after the write lock is
taken, that we immediately unlock it, and lock it right before we unlock
it again. In this way tsan thinks there are no locks held while
referencing protected data on the read or write side.
we still need to use atomics to ensure that tsan recognizes that we are
doing atomic accesses safely, but thats ok, and we still get warnings if
we don't do that properly
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23671)
CLA: trivial
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24206)
Currently, rcu has a global bit of data, the CRYPTO_THREAD_LOCAL object
to store per thread data. This works in some cases, but fails in FIPS,
becuase it contains its own copy of the global key.
So
1) Make the rcu_thr_key a per-context variable, and force
ossl_rcu_lock_new to be context aware
2) Store a pointer to the context in the lock object
3) Use the context to get the global thread key on read/write lock
4) Use ossl_thread_start_init to properly register a cleanup on thread
exit
5) Fix up missed calls to OSSL_thread_stop() in our tests
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24162)
The atomics fallbacks were using 'void *' as a generic transport for all
possible scalar and pointer types, with the hypothesis that a pointer is
as large as the largest possible scalar type that we would use.
Then enters the use of uint64_t, which is larger than a pointer on any
32-bit system (or any system that has 32-bit pointer configurations).
We could of course choose a larger type as a generic transport. However,
that only pushes the problem forward in time... and it's still a hack.
It's therefore safer to reimplement the fallbacks per type that atomics
are used for, and deal with missing per type fallbacks when the need
arrises in the future.
For test build purposes, the macro USE_ATOMIC_FALLBACKS is introduced.
If OpenSSL is configured with '-DUSE_ATOMIC_FALLBACKS', the fallbacks
will be used, unconditionally.
Fixes#24096
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24123)
Since the addition of macos14 M1 runners in our CI jobs we've been
seeing periodic random failures in the test_threads CI job.
Specifically we've seen instances in which the shared pointer in the
test (which points to a monotonically incrementing uint64_t went
backwards.
From taking a look at the disassembled code in the failing case, we see
that __atomic_load_n when emitted in clang 15 looks like this
0000000100120488 <_ossl_rcu_uptr_deref>:
100120488: f8bfc000 ldapr x0, [x0]
10012048c: d65f03c0 ret
Notably, when compiling with gcc on the same system we get this output
instead:
0000000100120488 <_ossl_rcu_uptr_deref>:
100120488: f8bfc000 ldar x0, [x0]
10012048c: d65f03c0 ret
Checking the arm docs for the difference between ldar and ldapr:
https://developer.arm.com/documentation/ddi0602/2023-09/Base-Instructions/LDAPR--Load-Acquire-RCpc-Register-https://developer.arm.com/documentation/dui0802/b/A64-Data-Transfer-Instructions/LDAR
It seems that the ldar instruction provides a global cpu fence, not
completing until all writes in a given cpus writeback queue have
completed
Conversely, the ldapr instruction attmpts to achieve performance
improvements by honoring the Local Ordering register available in the
system coprocessor, only flushing writes in the same address region as
other cpus on the system.
I believe that on M1 virtualized cpus the ldapr is not properly ordering
writes, leading to an out of order read, despite the needed fencing.
I've opened an issue with apple on this here:
https://developer.apple.com/forums/thread/749530
I believe that it is not safe to issue an ldapr instruction unless the
programmer knows that the Local order registers are properly configured
for use on the system.
So to fix it I'm proposing with this patch that we, in the event that:
1) __APPLE__ is defined
AND
2) __clang__ is defined
AND
3) __aarch64__ is defined
during the build, that we override the ATOMIC_LOAD_N macro in the rcu
code such that it uses a custom function with inline assembly to emit
the ldar instruction rather than the ldapr instruction. The above
conditions should get us to where this is only used on more recent MAC
cpus, and only in the case where the affected clang compiler emits the
offending instruction.
I've run this patch 10 times in our CI and failed to reproduce the
issue, whereas previously I could trigger it within 5 runs routinely.
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23974)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Release: yes
(cherry picked from commit 0ce7d1f355)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24034)
Introduce an RCU lock implementation as an alternative locking mechanism
to openssl. The api is documented in the ossl_rcu.pod
file
Read side implementaiton is comparable to that of RWLOCKS:
ossl_rcu_read_lock(lock);
<
critical section in which data can be accessed via
ossl_derefrence
>
ossl_rcu_read_unlock(lock);
Write side implementation is:
ossl_rcu_write_lock(lock);
<
critical section in which data can be updated via
ossl_assign_pointer
and stale data can optionally be scheduled for removal
via ossl_rcu_call
>
ossl_rcu_write_unlock(lock);
...
ossl_synchronize_rcu(lock);
ossl_rcu_call fixup
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22729)
issue: https://github.com/openssl/openssl/issues/21718
build break reported:
crypto/threads_pthread.c:76:5: warning: implicit declaration of function 'pthread_mutexattr_settype'; did you mean 'pthread_mutexattr_destroy'? [-Wimplicit-function-declaration]
76 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| pthread_mutexattr_destroy
crypto/threads_pthread.c:76:38: error: 'PTHREAD_MUTEX_NORMAL' undeclared (first use in this function); did you mean 'PTHREAD_MUTEX_TIMED_NP'?
76 | pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL);
| ^~~~~~~~~~~~~~~~~~~~
| PTHREAD_MUTEX_TIMED_NP
This occurs because PTHREAD_MUTEX_NORMAL is only defined in glibc if
__USE_UNIX98 or __USE_XOPEN2K8 is defined, which is derived from setting
__USE_POSIX_C_SOURCE or __XOPEN_SOURCE is selected in the glibc feature
set for a build. Since openssl selects no specific feature set from
glibc, the build break occurs
We could select a feature set of course, but that seems like a
significant discussion to have prior to doing so. Instead, the simpler
solution is to just not set the mutex type at all, given that
pthread_mutexattr_init sets the default mutex type, which should be akin
to normal anyway (i.e. no mutex error checking or allowed-recursive
behavior)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21726)
macOS 10.7 and 10.8 had a bit wired clang which is detected as
`__GNUC__` which has `__ATOMIC_ACQ_REL` but it excepts one option at
`__atomic_is_lock_free` instead of 2.
This prevents OpenSSL to be compiled on such systems.
Fixes: #18055
Signed-off-by: Kirill A. Korinsky <kirill@korins.ky>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18056)
We've had a report of a linker failure on some platforms (this one was
linux ARM) that apparently did not have pthread_atfork. It's strange that
this has not been reported before but the simplest solution is just to
remove this from the library since it isn't really used anyway.
Currently it is called to set up the fork handlers OPENSSL_fork_prepare,
OPENSSL_fork_parent and OPENSSL_fork_child. However all of those functions
are no-ops. This is a remnant from earlier code that got removed. We can
safely remove it now.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17842)
Standard Posix Threads (SPT) Threads are an older separate branch of
pthreads that do not support some of the capabilities in the current
Posix User Threads (PUT).
The change also includes a rename of the close field of OSSL_STORE_LOADER
which was causing preprocessor conflicts.
Fixes#15885
Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15886)
Fixes: #15809
Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15812)