]> git.ipfire.org Git - thirdparty/openssl.git/commit
Fix missing unlock in decoder_pkey.c
authorNeil Horman <nhorman@openssl.org>
Sun, 10 Aug 2025 21:55:15 +0000 (17:55 -0400)
committerNeil Horman <nhorman@openssl.org>
Tue, 12 Aug 2025 18:15:50 +0000 (14:15 -0400)
commitc0527256d2e6a148931e1d8b9b0ff4af7564caae
tree8d3dbef2d64443bfddc3c4102dca4c34bcf7eb55
parent7d78cd722b63e53a668c7ec13b9eeb6e13e32f13
Fix missing unlock in decoder_pkey.c

We hit an assertion failure during a call to CRYPTO_THREAD_read_lock
during memfail testing.

This was caused by us attempting to take a read lock in the same thread
that already held the same lock for writing resulting in an EBUSY
return.

This occured because we triggered a memory failure path in
DECODER_new_for_pkey, which never unlocked a write lock we were holding.

Fix it by ensuring the lock is released in the error path.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28216)
crypto/encode_decode/decoder_pkey.c