commit | f712c86eda36a59c5939879edda811c771990241 | [log] [tgz] |
---|---|---|
author | David Benjamin <davidben@google.com> | Mon May 22 16:13:08 2023 -0400 |
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue May 23 01:04:21 2023 +0000 |
tree | 94dd61d7a3ff39c61289d4692c14f6376c5e9bd5 | |
parent | b0251b12956ed8e9e41f7bf0bbb02b337e17ad52 [diff] |
Avoid locks in CRYPTO_free_ex_data Every time we free a type with ex_data (RSA, EC_KEY, DSA, SSL_CTX, SSL, SSL_SESSION, X509, X509_STORE), we allocate and take a read lock. The allocation means, if we believe in malloc failures, it is possible to leak memory on malloc failure. The read lock causes an unnecessary bit of contention writing to the cache line. Instead, since we never remove ex_data entries, just thread them in a singly-linked list. This way we only need to synchronize when to stop iterating. Add a counter to synchronize that. (Or we could make each 'next' pointers atomic, but this seemed more straightforward.) (I suspect this doesn't matter much, but it was shorter and we were already allocating the funcs structures anyway.) Bug: 570 Change-Id: Ie7ba5cc44f2b71ebd79c8971e784912d53af7f5c Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/60025 Reviewed-by: Adam Langley <agl@google.com> Commit-Queue: Adam Langley <agl@google.com> Auto-Submit: David Benjamin <davidben@google.com>
BoringSSL is a fork of OpenSSL that is designed to meet Google's needs.
Although BoringSSL is an open source project, it is not intended for general use, as OpenSSL is. We don't recommend that third parties depend upon it. Doing so is likely to be frustrating because there are no guarantees of API or ABI stability.
Programs ship their own copies of BoringSSL when they use it and we update everything as needed when deciding to make API changes. This allows us to mostly avoid compromises in the name of compatibility. It works for us, but it may not work for you.
BoringSSL arose because Google used OpenSSL for many years in various ways and, over time, built up a large number of patches that were maintained while tracking upstream OpenSSL. As Google's product portfolio became more complex, more copies of OpenSSL sprung up and the effort involved in maintaining all these patches in multiple places was growing steadily.
Currently BoringSSL is the SSL library in Chrome/Chromium, Android (but it's not part of the NDK) and a number of other apps/programs.
Project links:
There are other files in this directory which might be helpful: