[openssl/openssl] 8bf997: fixes crash on NetBSD

0 views
Skip to first unread message

nikolapajkovsky

unread,
2:29 PM (8 hours ago) 2:29 PM
to openssl...@openssl.org
Branch: refs/heads/openssl-3.6
Home: https://github.com/openssl/openssl
Commit: 8bf997d8d061b9556485e57f810916f685033601
https://github.com/openssl/openssl/commit/8bf997d8d061b9556485e57f810916f685033601
Author: Nikola Pajkovsky <nik...@openssl.org>
Date: 2026-02-07 (Sat, 07 Feb 2026)

Changed paths:
M crypto/initthread.c

Log Message:
-----------
fixes crash on NetBSD

commit 5bf627c977f7 introduced recursion_guard which is by default set
to -1 of CRYPTO_THREAD_ID type. NetBSD pthread_equal dereferences
pthread_t in order to check t1->pt_magic == PT_MAGIC. Setting to -1
is not wise, it's better to set it to 0. Dereferencing of the
pthread_t happens only if t1/t2 are not NULL.

NetBSD defines pthread_equal:

int
pthread_equal(pthread_t t1, pthread_t t2)
{
...
pthread__error(0, "Invalid thread",
(t1 != NULL) && (t1->pt_magic == PT_MAGIC));
...
/* Nothing special here. */
return (t1 == t2);
}

The problem only occurs only when ossl is compiled with threads on NetBSD.

Fixes #29828
Fixes: 5bf627c977f7 ("ensure destructor key is created prior to any other thread specific key")
Signed-off-by: Nikola Pajkovsky <nik...@openssl.org>

Reviewed-by: Neil Horman <nho...@openssl.org>
Reviewed-by: Saša Nedvědický <sas...@openssl.org>
Reviewed-by: Tomas Mraz <to...@openssl.org>
Reviewed-by: Tim Hudson <t...@openssl.org>
MergeDate: Sat Feb 7 18:20:07 2026
(Merged from https://github.com/openssl/openssl/pull/29952)


Commit: fdbbf3c26066389b1c4ffc0c4b7ff792bf340d7b
https://github.com/openssl/openssl/commit/fdbbf3c26066389b1c4ffc0c4b7ff792bf340d7b
Author: Nikola Pajkovsky <nik...@openssl.org>
Date: 2026-02-07 (Sat, 07 Feb 2026)

Changed paths:
M crypto/initthread.c
M crypto/threads_none.c

Log Message:
-----------
alternative solution

Signed-off-by: Nikola Pajkovsky <nik...@openssl.org>

Reviewed-by: Neil Horman <nho...@openssl.org>
Reviewed-by: Saša Nedvědický <sas...@openssl.org>
Reviewed-by: Tomas Mraz <to...@openssl.org>
Reviewed-by: Tim Hudson <t...@openssl.org>
MergeDate: Sat Feb 7 18:20:11 2026
(Merged from https://github.com/openssl/openssl/pull/29952)


Compare: https://github.com/openssl/openssl/compare/a7b47bda7246...fdbbf3c26066

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications
Reply all
Reply to author
Forward
0 new messages