[openssl/openssl] 364248: Don't take a write lock when freeing an EVP_PKEY

Matt Caswell noreply at github.com
Mon May 29 14:11:05 UTC 2023


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: 36424806d699233b9a90a3a97fff3011828e2548
      https://github.com/openssl/openssl/commit/36424806d699233b9a90a3a97fff3011828e2548
  Author: Matt Caswell <matt at openssl.org>
  Date:   2023-05-29 (Mon, 29 May 2023)

  Changed paths:
    M crypto/evp/keymgmt_lib.c
    M crypto/evp/p_lib.c
    M doc/internal/man3/evp_keymgmt_util_export_to_provider.pod
    M include/crypto/evp.h

  Log Message:
  -----------
  Don't take a write lock when freeing an EVP_PKEY

When freeing the last reference to an EVP_PKEY there is no point in
taking the lock for the key. It is the last reference and is being freed
so must only be being used by a single thread.

This should not have been the source of any contention so its unclear to
what extent this will improve performance. But we should not be locking
when we don't need to.

Partially fixes #20286

Reviewed-by: Hugo Landau <hlandau at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Richard Levitte <levitte at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20932)




More information about the openssl-commits mailing list