openssl/crypto/x509
Neil Horman 7b07bc4c99 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:58:51 +01:00
..
build.info feat: add support for issuedOnBehalfOf X.509v3 extension 2024-08-27 16:48:57 +02:00
by_dir.c Copyright year updates 2024-09-05 09:35:49 +02:00
by_file.c Copyright year updates 2024-04-09 13:43:26 +02:00
by_store.c Copyright year updates 2024-09-05 09:35:49 +02:00
ext_dat.h Copyright year updates 2024-09-05 09:35:49 +02:00
pcy_cache.c
pcy_data.c
pcy_lib.c
pcy_local.h
pcy_map.c
pcy_node.c
pcy_tree.c Copyright year updates 2024-09-05 09:35:49 +02:00
standard_exts.h Copyright year updates 2024-09-05 09:35:49 +02:00
t_acert.c Copyright year updates 2024-09-05 09:35:49 +02:00
t_crl.c
t_req.c
t_x509.c
v3_ac_tgt.c Add support for targetingInformation X.509v3 extension 2024-06-17 14:03:25 +02:00
v3_addr.c make_addressPrefix(): Fix a memory leak in error case 2024-04-12 10:56:28 +02:00
v3_admis.c Adjust naming authority formatting when printing out admission extension 2024-11-07 10:30:43 +01:00
v3_admis.h
v3_akeya.c
v3_akid.c
v3_asid.c Copyright year updates 2024-04-09 13:43:26 +02:00
v3_audit_id.c feat: support auditIdentity X.509v3 extension 2024-08-26 10:38:44 +01:00
v3_battcons.c doc: the basicAttConstraints X.509v3 extension 2024-07-24 16:14:17 -04:00
v3_bcons.c
v3_bitst.c
v3_conf.c
v3_cpols.c
v3_crld.c x509: add a newline after printing Full Name 2024-11-05 14:22:36 +01:00
v3_enum.c
v3_extku.c Copyright year updates 2024-09-05 09:35:49 +02:00
v3_genn.c Copyright year updates 2024-09-05 09:35:49 +02:00
v3_group_ac.c
v3_ia5.c
v3_ind_iss.c
v3_info.c
v3_int.c
v3_iobo.c feat: add support for issuedOnBehalfOf X.509v3 extension 2024-08-27 16:48:57 +02:00
v3_ist.c Copyright year updates 2024-04-09 13:43:26 +02:00
v3_lib.c
v3_ncons.c Copyright year updates 2024-09-05 09:35:49 +02:00
v3_no_ass.c
v3_no_rev_avail.c
v3_pci.c Copyright year updates 2024-09-05 09:35:49 +02:00
v3_pcia.c
v3_pcons.c
v3_pku.c
v3_pmaps.c
v3_prn.c
v3_purp.c
v3_san.c Fix memory leak on failure in copy_issuer() 2024-11-07 10:20:16 +01:00
v3_sda.c feat: support userNotice X.509v3 extension 2024-07-04 09:36:11 +02:00
v3_single_use.c
v3_skid.c
v3_soa_id.c
v3_sxnet.c Copyright year updates 2024-04-09 13:43:26 +02:00
v3_tlsf.c
v3_usernotice.c feat: support userNotice X.509v3 extension 2024-07-04 09:36:11 +02:00
v3_utf8.c
v3_utl.c Copyright year updates 2024-09-05 09:35:49 +02:00
v3err.c
x509_acert.c Copyright year updates 2024-09-05 09:35:49 +02:00
x509_acert.h Copyright year updates 2024-09-05 09:35:49 +02:00
x509_att.c constify ossl_x509at_add1_attr() 2024-07-10 16:19:06 +02:00
x509_cmp.c
x509_d2.c Copyright year updates 2024-09-05 09:35:49 +02:00
x509_def.c Copyright year updates 2024-09-05 09:35:49 +02:00
x509_err.c Add Version Check for CSR Verification 2024-06-21 15:40:45 -04:00
x509_ext.c
x509_local.h
x509_lu.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:51 +01:00
x509_meth.c
x509_obj.c Copyright year updates 2024-09-05 09:35:49 +02:00
x509_r2x.c
x509_req.c extend X509_REQ_add_extensions_nid() and thuis APPS/req to support augmenting/overriding existing extensions 2024-07-10 16:19:26 +02:00
x509_set.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:51 +01:00
x509_trust.c
x509_txt.c
x509_v3.c Fix doc and use of_X509v3_add_extensions() in case sk_X509_EXTENSION_num(exts) <= 0 2024-11-13 17:20:26 +01:00
x509_vfy.c
x509_vpm.c
x509aset.c Copyright year updates 2024-09-05 09:35:49 +02:00
x509cset.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:51 +01:00
x509name.c
x509rset.c Copyright year updates 2024-09-05 09:35:49 +02:00
x509spki.c
x509type.c
x_all.c Increase limit for CRL download 2024-10-08 16:00:03 +02:00
x_attrib.c Copyright year updates 2024-09-05 09:35:49 +02:00
x_crl.c
x_exten.c Copyright year updates 2024-09-05 09:35:49 +02:00
x_ietfatt.c Copyright year updates 2024-09-05 09:35:49 +02:00
x_name.c Copyright year updates 2024-09-05 09:35:49 +02:00
x_pubkey.c Copyright year updates 2024-09-05 09:35:49 +02:00
x_req.c
x_x509.c
x_x509a.c