openssl: Ensure the thread ID is never zero
This might otherwise cause problems because OpenSSL tries to lock mutexes recursively if it assumes the lock is held by a different thread e.g. during FIPS initialization.
This commit is contained in:
@@ -129,7 +129,9 @@ static void destroy_function(struct CRYPTO_dynlock_value *lock,
|
|||||||
*/
|
*/
|
||||||
static unsigned long id_function(void)
|
static unsigned long id_function(void)
|
||||||
{
|
{
|
||||||
return (unsigned long)thread_current_id();
|
/* ensure the thread ID is never zero, otherwise OpenSSL might try to
|
||||||
|
* acquire locks recursively */
|
||||||
|
return 1 + (unsigned long)thread_current_id();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user