openssl/crypto/ec
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
..
asm Copyright year updates 2024-09-05 09:35:49 +02:00
curve448 Copyright year updates 2024-09-05 09:35:49 +02:00
build.info Fix a few incorrect paths in some build.info files 2024-02-02 14:12:49 +01:00
curve25519.c Copyright year updates 2024-09-05 09:35:49 +02:00
ec2_oct.c Update copyright year 2022-05-03 13:34:51 +01:00
ec2_smpl.c crypto: Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:01 +11:00
ec_ameth.c Honor OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT as set and default to UNCOMPRESSED 2022-11-29 16:03:04 +01:00
ec_asn1.c Fix NULL ptr dereference on EC_POINT *point 2024-09-26 10:04:30 +02:00
ec_backend.c Remove double engine reference in ossl_ec_key_dup() 2024-09-26 10:26:19 +02:00
ec_check.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
ec_curve.c Copyright year updates 2024-09-05 09:35:49 +02:00
ec_cvt.c Update copyright year 2021-03-11 13:27:36 +00:00
ec_deprecated.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
ec_err.c Fix potential infinite loops in ECDSA signing. 2023-03-01 09:20:49 +11:00
ec_key.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ec_kmeth.c Copyright year updates 2023-09-07 09:59:15 +01:00
ec_lib.c ec: change FIPS zeroization to use the OPENSSL_PEDANTIC_ZEROIZATION define 2024-11-28 15:13:35 +01:00
ec_local.h Copyright year updates 2024-09-05 09:35:49 +02:00
ec_mult.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ec_oct.c Fix NULL ptr dereference on EC_POINT *point 2024-09-26 10:04:30 +02:00
ec_pmeth.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
ec_print.c Copyright year updates 2024-09-05 09:35:49 +02:00
ecdh_kdf.c Rename all getters to use get/get0 in name 2021-06-01 12:40:00 +02:00
ecdh_ossl.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
ecdsa_ossl.c Complain about a missing digest when doing deterministic ECDSA 2024-09-09 09:51:50 +02:00
ecdsa_sign.c Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call 2020-11-13 09:35:02 +01:00
ecdsa_vrf.c Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call 2020-11-13 09:35:02 +01:00
eck_prn.c Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
ecp_mont.c crypto: Fix various typos, repeated words, align some spelling to LDP. 2022-10-12 16:55:01 +11:00
ecp_nist.c Update copyright year 2021-03-11 13:27:36 +00:00
ecp_nistp224.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ecp_nistp256.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ecp_nistp384.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ecp_nistp521.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ecp_nistputil.c Update copyright year 2021-03-11 13:27:36 +00:00
ecp_nistz256.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ecp_nistz256_table.c Following the license change, modify the boilerplates in crypto/ec/ 2018-12-06 14:51:47 +01:00
ecp_oct.c Replace some of the ERR_clear_error() calls with mark calls 2021-05-13 19:26:06 +02:00
ecp_ppc.c ppccap.c: Split out algorithm-specific functions 2021-06-25 08:49:45 +01:00
ecp_s390x_nistp.c Copyright year updates 2023-09-28 14:23:29 +01:00
ecp_sm2p256.c Fix declspec align syntax 2023-12-19 13:57:32 +01:00
ecp_sm2p256_table.c Optimize SM2 on aarch64 2023-08-24 14:57:35 +02:00
ecp_smpl.c nit: fix some pointer comparisons 2022-10-12 16:55:28 +11:00
ecx_backend.c Copyright year updates 2024-04-09 13:43:26 +02:00
ecx_backend.h Fix the KEYNID2TYPE macro 2020-05-04 09:30:55 +01:00
ecx_key.c Fix potential use-after-free in REF_PRINT_COUNT 2024-12-10 14:58:08 +01:00
ecx_meth.c Copyright year updates 2023-09-07 09:59:15 +01:00
ecx_s390x.c Update copyright year 2020-04-23 13:55:52 +01:00