openssl/crypto/dh
Neil Horman dc10ffc283 Fix potential use-after-free in REF_PRINT_COUNT
We use REF_PRINT_COUNT to dump out the value of various reference
counters in our code

However, we commonly use this macro after an increment or decrement.  On
increment its fine, but on decrement its not, because the macro
dereferences the object holding the counter value, which may be freed by
another thread, as we've given up our ref count to it prior to using the
macro.

The rule is that we can't reference memory for an object once we've
released our reference, so lets fix this by altering REF_PRINT_COUNT to
accept the value returned by CRYPTO_[UP|DOWN]_REF instead.  The
eliminates the need to dereference the memory the object points to an
allows us to use the call after we release our reference count

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25664)
2024-12-10 14:58:08 +01:00
..
build.info EVP_PKEY & DH: Make DH EVP_PKEY_CTX parameter ctrls / setters more available 2020-12-16 11:55:39 +01:00
dh_ameth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
dh_asn1.c Update copyright year 2021-03-11 13:27:36 +00:00
dh_backend.c Copyright year updates 2023-09-07 09:59:15 +01:00
dh_check.c Copyright year updates 2024-04-09 13:43:26 +02:00
dh_depr.c
dh_err.c Make DH_check_pub_key() and DH_generate_key() safer yet 2023-11-06 07:55:01 +00:00
dh_gen.c Use libctx when generating DH parameters 2022-11-11 11:59:23 +01:00
dh_group_params.c Use as small dh key size as possible to support the security 2022-07-18 08:06:17 +01:00
dh_kdf.c Remove duplicated #include headers 2022-05-04 13:46:10 +10:00
dh_key.c Make DH_check_pub_key() and DH_generate_key() safer yet 2023-11-06 07:55:01 +00:00
dh_lib.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
dh_local.h Rename OPENSSL_CTX prefix to OSSL_LIB_CTX 2020-10-15 11:59:53 +01:00
dh_meth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
dh_pmeth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
dh_prn.c Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call 2020-11-13 09:35:02 +01:00
dh_rfc5114.c Update copyright year 2021-03-11 13:27:36 +00:00