Skip to content

Commit 0084756

Browse files
committed
ci: follow tsan
1 parent e7f1e34 commit 0084756

6 files changed

Lines changed: 25 additions & 262 deletions

File tree

.github/asan.supp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# OpenSSL v1.1
22
leak:X509_REQ_dup
3-
# OpenSSL v3
4-
leak:DSA_generate_parameters_ex
5-
leak:d2i_X509_REQ_bio
3+
4+
# github ci OpenSSL v3.0
5+
leak:OPENSSL_init_ssl
66

77
## MacOS
88
#leak:_objc_init

.github/lua-openssl.supp

Lines changed: 7 additions & 248 deletions
Original file line numberDiff line numberDiff line change
@@ -280,82 +280,17 @@
280280
}
281281

282282
# OpenSSL-1.1.1
283-
{
284-
Maybe bug in TS_REQ_to_TS_VERIFY_CTX
285-
Memcheck:Leak
286-
match-leak-kinds: definite
287-
fun:malloc
288-
fun:TS_REQ_to_TS_VERIFY_CTX
289-
obj:*
290-
}
291283

292-
{
293-
Maybe bug in OCSP_request_sign
294-
Memcheck:Leak
295-
match-leak-kinds: definite
296-
fun:malloc
297-
fun:CRYPTO_zalloc
298-
obj:/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
299-
fun:ASN1_item_new
300-
fun:OCSP_request_sign
301-
obj:*
302-
}
303284

304-
{
305-
Maybe bug in CMS_decrypt_set1_password
306-
Memcheck:Leak
307-
match-leak-kinds: definite
308-
fun:malloc
309-
obj:/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
310-
fun:CMS_RecipientInfo_decrypt
311-
fun:CMS_decrypt_set1_password
312-
obj:*
313-
}
314-
315-
{
316-
<insert_a_suppression_name_here>
317-
Memcheck:Leak
318-
match-leak-kinds: definite
319-
fun:malloc
320-
fun:CRYPTO_zalloc
321-
fun:EVP_PKEY_new
322-
}
323-
324-
{
325-
<CRYPTO_THREAD_lock_new>
326-
Memcheck:Leak
327-
match-leak-kinds: indirect
328-
fun:malloc
329-
fun:CRYPTO_zalloc
330-
fun:CRYPTO_THREAD_lock_new
331-
}
332-
333-
{
334-
<CRYPTO_THREAD_lock_new>
335-
Memcheck:Leak
336-
match-leak-kinds: reachable
337-
fun:malloc
338-
fun:CRYPTO_zalloc
339-
fun:CRYPTO_THREAD_lock_new
340-
}
341-
342-
{
343-
Lua 5.1 OpenSSL 1.1.1f
344-
Memcheck:Leak
345-
match-leak-kinds: reachable
346-
fun:malloc
347-
fun:CRYPTO_zalloc
348-
fun:EVP_MD_meth_new
349-
}
285+
# OpenSSL-3
350286

287+
# BN_GENCB_call
351288
{
352-
<EVP_MD_meth_new>
353-
Memcheck:Leak
354-
match-leak-kinds: reachable
355-
fun:malloc
356-
fun:CRYPTO_malloc
357-
fun:CRYPTO_zalloc
358-
fun:EVP_MD_meth_new
289+
<BN_GENCB_call>
290+
Memcheck:Cond
291+
fun:BN_GENCB_call
292+
obj:*/libcrypto.so.3
293+
fun:Bisprime
359294
}
360295

361296
{
@@ -401,182 +336,6 @@
401336
fun:BN_bin2bn
402337
}
403338

404-
{
405-
Lua 5.1 OpenSSL 1.1.1f
406-
Memcheck:Leak
407-
match-leak-kinds: reachable
408-
fun:malloc
409-
fun:CRYPTO_zalloc
410-
fun:EVP_CIPHER_meth_new
411-
}
412-
413-
{
414-
Lua 5.1 OpenSSL 1.1.1f
415-
Memcheck:Leak
416-
match-leak-kinds: reachable
417-
fun:malloc
418-
fun:_dl_close_worker.part.0
419-
fun:_dl_close_worker
420-
fun:_dl_close
421-
fun:_dl_catch_exception
422-
fun:_dl_catch_error
423-
fun:_dlerror_run
424-
fun:dlclose
425-
}
426-
427-
{
428-
Lua 5.1 OpenSSL 1.1.1f
429-
Memcheck:Leak
430-
match-leak-kinds: indirect
431-
fun:malloc
432-
fun:CRYPTO_zalloc
433-
fun:BN_new
434-
}
435-
436-
{
437-
Lua 5.1 OpenSSL 1.1.1f
438-
Memcheck:Leak
439-
match-leak-kinds: indirect
440-
fun:malloc
441-
fun:CRYPTO_zalloc
442-
fun:CRYPTO_THREAD_lock_new
443-
}
444-
445-
{
446-
<insert_a_suppression_name_here>
447-
Memcheck:Leak
448-
match-leak-kinds: indirect
449-
fun:malloc
450-
fun:CRYPTO_zalloc
451-
fun:ENGINE_new
452-
}
453-
454-
{
455-
<insert_a_suppression_name_here>
456-
Memcheck:Leak
457-
match-leak-kinds: indirect
458-
fun:malloc
459-
fun:CRYPTO_zalloc
460-
fun:RSA_new_method
461-
}
462-
463-
{
464-
asn1.c ASN1_TYPE_set1 in openssl_asn1type_new
465-
Memcheck:Leak
466-
match-leak-kinds: indirect
467-
fun:malloc
468-
fun:ASN1_STRING_set
469-
fun:ASN1_STRING_copy
470-
fun:ASN1_STRING_dup
471-
fun:ASN1_TYPE_set1
472-
obj:*
473-
}
474-
475-
{
476-
asn1.c ASN1_TYPE_set1 in openssl_asn1type_new
477-
Memcheck:Leak
478-
match-leak-kinds: definite
479-
fun:malloc
480-
fun:CRYPTO_zalloc
481-
fun:ASN1_STRING_type_new
482-
fun:ASN1_STRING_dup
483-
fun:ASN1_TYPE_set1
484-
obj:*
485-
}
486-
487-
{
488-
ASN1_item_d2i
489-
Memcheck:Leak
490-
match-leak-kinds: indirect
491-
fun:malloc
492-
fun:CRYPTO_zalloc
493-
obj:/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
494-
fun:BN_bin2bn
495-
}
496-
497-
{
498-
BIO_new_bio_pair
499-
Memcheck:Leak
500-
match-leak-kinds: indirect
501-
fun:malloc
502-
fun:CRYPTO_zalloc
503-
obj:/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
504-
fun:BIO_new
505-
fun:BIO_new_bio_pair
506-
obj:*
507-
}
508-
509-
{
510-
BIO_new_bio_pair
511-
Memcheck:Leak
512-
match-leak-kinds: indirect
513-
fun:malloc
514-
obj:/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
515-
fun:BIO_ctrl
516-
fun:BIO_new_bio_pair
517-
obj:*
518-
}
519-
520-
{
521-
BIO_new_bio_pair
522-
Memcheck:Leak
523-
match-leak-kinds: definite
524-
fun:malloc
525-
fun:CRYPTO_zalloc
526-
fun:BIO_new
527-
fun:BIO_new_bio_pair
528-
obj:*
529-
}
530-
531-
{
532-
<BIO_meth_new>
533-
Memcheck:Leak
534-
match-leak-kinds: indirect
535-
fun:malloc
536-
fun:CRYPTO_zalloc
537-
fun:BIO_meth_new
538-
}
539-
540-
{
541-
<BIO_meth_new>
542-
Memcheck:Leak
543-
match-leak-kinds: indirect
544-
fun:malloc
545-
fun:CRYPTO_malloc
546-
fun:CRYPTO_zalloc
547-
fun:BIO_meth_new
548-
}
549-
550-
{
551-
<BIO_meth_new>
552-
Memcheck:Leak
553-
match-leak-kinds: indirect
554-
fun:malloc
555-
fun:CRYPTO_strdup
556-
fun:BIO_meth_new
557-
}
558-
559-
{
560-
<BIO_meth_new>
561-
Memcheck:Leak
562-
match-leak-kinds: indirect
563-
fun:malloc
564-
fun:CRYPTO_malloc
565-
fun:CRYPTO_strdup
566-
fun:BIO_meth_new
567-
}
568-
569-
# OpenSSL-3
570-
571-
# BN_GENCB_call
572-
{
573-
<BN_GENCB_call>
574-
Memcheck:Cond
575-
fun:BN_GENCB_call
576-
obj:*/libcrypto.so.3
577-
fun:Bisprime
578-
}
579-
580339
{
581340
<OPENSSL_init_ssl>
582341
Memcheck:Leak

.github/workflows/check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696

9797
clang-tsan:
9898
runs-on: ubuntu-latest
99+
continue-on-error: true # FIXME: OpenSSL-3
99100
env:
100101
CC: clang
101102
CXX: clang++

src/ocsp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,13 @@ openssl_ocsp_request_add_ext(lua_State *L)
296296
return openssl_pushresult(L, ret);
297297
}
298298

299+
#if OPENSSL_VERSION_NUMBER > 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
300+
301+
#if OPENSSL_VERSION_NUMBER < 0x30000000L
302+
#undef CONSTIFY_OPENSSL
303+
#define CONSTIFY_OPENSSL
304+
#endif
305+
299306
#ifdef PEM_write_bio_OCSP_REQUEST
300307
#undef PEM_write_bio_OCSP_REQUEST
301308
#endif
@@ -308,6 +315,7 @@ openssl_ocsp_request_add_ext(lua_State *L)
308315
#define PEM_write_bio_OCSP_RESPONSE(bp,o) PEM_ASN1_write_bio( \
309316
(int (*)(CONSTIFY_OPENSSL void *, unsigned char **))i2d_OCSP_RESPONSE, \
310317
PEM_STRING_OCSP_RESPONSE, bp,(char *)(o), NULL,NULL,0,NULL,NULL)
318+
#endif
311319

312320
/***
313321
export a ocsp_request object to encoded data

src/openssl.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ static const luaL_Reg eay_functions[] = {
408408
{ NULL, NULL }
409409
};
410410

411-
#if defined(OPENSSL_THREADS)
411+
#if defined(OPENSSL_THREADS) && \
412+
(OPENSSL_VERSION_NUMBER < 0x30000000L || defined(LIBRESSL_VERSION_NUMBER))
412413
void CRYPTO_thread_setup(void);
413414
void CRYPTO_thread_cleanup(void);
414415
#endif
@@ -475,9 +476,6 @@ openssl_finalize(void)
475476
#endif /* OPENSSL_NO_CRYPTO_MDEBUG */
476477
#else
477478

478-
#if defined(OPENSSL_THREADS)
479-
CRYPTO_thread_cleanup();
480-
#endif
481479

482480
#endif
483481
}
@@ -491,15 +489,12 @@ openssl_initialize()
491489
if (++_guard > 0) return;
492490
#endif
493491

494-
#ifndef __SANITIZE_THREAD__
492+
493+
#if (OPENSSL_VERSION_NUMBER < 0x30000000L || defined(LIBRESSL_VERSION_NUMBER))
495494
atexit(openssl_finalize);
496-
#endif
497495

498-
#if defined(OPENSSL_THREADS)
499496
CRYPTO_thread_setup();
500-
#endif
501497

502-
#if (OPENSSL_VERSION_NUMBER < 0x30000000L || defined(LIBRESSL_VERSION_NUMBER))
503498
OpenSSL_add_all_ciphers();
504499
OpenSSL_add_all_digests();
505500
SSL_library_init();

src/th-lock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
#include <pthread.h>
9090
#endif
9191

92-
#if defined(OPENSSL_THREADS)
93-
92+
#if defined(OPENSSL_THREADS) && \
93+
(OPENSSL_VERSION_NUMBER < 0x30000000L || defined(LIBRESSL_VERSION_NUMBER))
9494
void CRYPTO_thread_setup(void);
9595
void CRYPTO_thread_cleanup(void);
9696

0 commit comments

Comments
 (0)