openssl/crypto/rsa
Neil Horman 4e581b0318 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)

(cherry picked from commit dc10ffc283)
2024-12-10 14:59:14 +01:00
..
build.info Remove RSA SSLv23 padding mode 2021-03-01 10:56:12 +01:00
rsa_acvp_test_params.c Update copyright year 2021-04-08 13:04:41 +01:00
rsa_ameth.c Fix a possible memleak in rsa_pub_encode 2023-09-11 10:48:54 +02:00
rsa_asn1.c Update copyright year 2021-04-08 13:04:41 +01:00
rsa_backend.c Copyright year updates 2023-10-26 14:21:19 +01:00
rsa_chk.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsa_crpt.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
rsa_depr.c Update copyright year 2020-04-23 13:55:52 +01:00
rsa_err.c crypto: updates to pass size_t to RAND_bytes_ex() 2021-06-01 18:13:56 +10:00
rsa_gen.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsa_lib.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:59:14 +01:00
rsa_local.h Fix change in behaviour of EVP_PKEY_CTRL_RSA_KEYGEN_BITS 2021-03-30 19:22:33 +02:00
rsa_meth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
rsa_mp.c Replace "a RSA" with "an RSA" 2022-12-07 09:37:25 +11:00
rsa_mp_names.c rsa: add ossl_ prefix to internal rsa_ calls. 2020-10-07 09:04:51 +10:00
rsa_none.c Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call 2020-11-13 09:35:02 +01:00
rsa_oaep.c Copyright year updates 2024-09-03 14:50:21 +02:00
rsa_ossl.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsa_pk1.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsa_pmeth.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsa_prn.c Update copyright year 2021-07-29 15:41:35 +01:00
rsa_pss.c Copyright year updates 2023-09-07 09:59:15 +01:00
rsa_saos.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
rsa_schemes.c rsa: add ossl_ prefix to internal rsa_ calls. 2020-10-07 09:04:51 +10:00
rsa_sign.c Refine the documents of several APIs 2022-12-16 18:59:28 +01:00
rsa_sp800_56b_check.c Copyright year updates 2024-01-30 13:13:27 +00:00
rsa_sp800_56b_gen.c Remove repeated words 2023-09-11 10:15:30 +02:00
rsa_x931.c Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call 2020-11-13 09:35:02 +01:00
rsa_x931g.c Copyright year updates 2023-09-07 09:59:15 +01:00