openssl/include/internal
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
..
__DECC_INCLUDE_EPILOGUE.H
__DECC_INCLUDE_PROLOGUE.H
asn1.h
bio_addr.h crypto: fix missing <winsock.h> indirection inclusion. 2024-09-05 17:02:51 +02:00
bio_tfo.h
bio.h
common.h Add defaults api to openssl build 2024-07-09 04:01:30 -04:00
comp.h Copyright year updates 2024-09-05 09:35:49 +02:00
conf.h
constant_time.h Copyright year updates 2024-09-05 09:35:49 +02:00
core.h
crmf.h CMP: add support for requesting cert template using genm/genp 2024-06-20 13:38:13 +02:00
cryptlib.h fips: continuous random bit generator tests 2024-09-19 08:44:14 +10:00
dane.h
deprecated.h
der.h
deterministic_nonce.h
dso.h
dsoerr.h
e_os.h Move inclusion of <winsock.h> out of "e_os.h" into a dedicated header file. 2024-09-05 17:02:51 +02:00
e_winsock.h Move inclusion of <winsock.h> out of "e_os.h" into a dedicated header file. 2024-09-05 17:02:51 +02:00
endian.h
err.h
ffc.h
hashtable.h hashtable: Support lockless reads 2024-08-21 15:21:25 +02:00
hpke_util.h
json_enc.h Copyright year updates 2024-04-09 13:43:26 +02:00
ktls.h Copyright year updates 2024-04-09 13:43:26 +02:00
list.h Rename list macros 2024-09-26 10:02:30 +02:00
namemap.h Copyright year updates 2024-09-05 09:35:49 +02:00
nelem.h
numbers.h Change all one's complement to ones' complement for consistency 2024-12-06 15:26:36 +01:00
o_dir.h
packet_quic.h
packet.h Copyright year updates 2024-09-05 09:35:49 +02:00
param_build_set.h
param_names.h.in
params.h
passphrase.h
priority_queue.h
property.h
propertyerr.h
provider.h
qlog_event_helpers.h Copyright year updates 2024-04-09 13:43:26 +02:00
qlog_events.h Copyright year updates 2024-04-09 13:43:26 +02:00
qlog.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_ackm.h Copyright year updates 2024-09-05 09:35:49 +02:00
quic_cc.h
quic_cfq.h
quic_channel.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_demux.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_engine.h
quic_error.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_fc.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_fifd.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_lcidm.h
quic_port.h
quic_predef.h
quic_rcidm.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_reactor.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_record_rx.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_record_tx.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_record_util.h
quic_rx_depack.h
quic_sf_list.h
quic_srt_gen.h
quic_srtm.h
quic_ssl.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_statm.h
quic_stream_map.h Change approach to SSL_pending API 2024-04-10 15:49:00 +02:00
quic_stream.h
quic_thread_assist.h
quic_tls.h
quic_tserver.h
quic_txp.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_txpim.h Copyright year updates 2024-04-09 13:43:26 +02:00
quic_types.h
quic_vlint.h
quic_wire_pkt.h
quic_wire.h
rcu.h Make rcu_thread_key context-aware 2024-04-19 09:22:53 -04:00
recordmethod.h
refcount.h Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ring_buf.h
safe_math.h
sha3.h Copyright year updates 2024-09-05 09:35:49 +02:00
sizes.h
sm3.h
sockets.h Change all one's complement to ones' complement for consistency 2024-12-06 15:26:36 +01:00
ssl3_cbc.h
ssl.h
sslconf.h
statem.h
symhacks.h
thread_arch.h Copyright year updates 2024-04-09 13:43:26 +02:00
thread_once.h
thread.h
time.h crypto: fix missing <winsock.h> indirection inclusion. 2024-09-05 17:02:51 +02:00
tlsgroups.h
to_hex.h ssl: factorize and improved hex conversion code 2024-08-07 19:25:10 +02:00
tsan_assist.h
uint_set.h
unicode.h