[MDEV-32229] Memory leaks while using ephemeral certificates Created: 2023-09-22  Updated: 2023-10-23  Resolved: 2023-10-23

Status: Closed
Project: MariaDB Server
Component/s: SSL
Affects Version/s: None
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: Alice Sherepa Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-32543 LSAN: 42872 bytes leaked in/by wolfSS... Closed
Problem/Incident
is caused by MDEV-31856 use ephemeral ssl certificates Closed

 Description   

MariaDB [(none)]> flush ssl;
Query OK, 0 rows affected (0,477 sec)
MariaDB [(none)]> flush ssl;
Query OK, 0 rows affected (0,086 sec)
shutdown;

=================================================================
==2720518==ERROR: LeakSanitizer: detected memory leaks
 
Direct leak of 9856 byte(s) in 28 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4ddac0d in CRYPTO_zalloc (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x17bc0d)
 
Indirect leak of 225336 byte(s) in 1298 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4ddac0d in CRYPTO_zalloc (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x17bc0d)
 
Indirect leak of 14728 byte(s) in 28 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4cfb94a  (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x9c94a)
 
Indirect leak of 14336 byte(s) in 28 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4cec35e in ASN1_item_sign_ctx (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x8d35e)
 
Indirect leak of 8736 byte(s) in 84 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4d1b34b in BN_MONT_CTX_new (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0xbc34b)
 
Indirect leak of 3456 byte(s) in 54 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4ddac0d in CRYPTO_zalloc (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x17bc0d)
    #2 0x558c3f7f9fcb in vio_set_cert_stuff /11.3/src/vio/viosslfactories.c:157
    #3 0x558c3f7fb6be in new_VioSSLFd /11.3/src/vio/viosslfactories.c:408
    #4 0x558c3f7fbb42 in new_VioSSLAcceptorFd /11.3/src/vio/viosslfactories.c:496
    #5 0x558c3e5e1a6f in reinit_ssl() /11.3/src/sql/mysqld.cc:4759
    #6 0x558c3ef153f8 in reload_acl_and_cache(THD*, unsigned long long, TABLE_LIST*, int*) /11.3/src/sql/sql_reload.cc:424
    #7 0x558c3e9ac1eb in mysql_execute_command(THD*, bool) /11.3/src/sql/sql_parse.cc:5190
    #8 0x558c3e9bd701 in mysql_parse(THD*, char*, unsigned int, Parser_state*) /11.3/src/sql/sql_parse.cc:7734
    #9 0x558c3e995356 in dispatch_command(enum_server_command, THD*, char*, unsigned int, bool) /11.3/src/sql/sql_parse.cc:1893
    #10 0x558c3e99209b in do_command(THD*, bool) /11.3/src/sql/sql_parse.cc:1406
    #11 0x558c3ee72676 in do_handle_one_connection(CONNECT*, bool) /11.3/src/sql/sql_connect.cc:1445
    #12 0x558c3ee71fd3 in handle_one_connection /11.3/src/sql/sql_connect.cc:1347
    #13 0x558c3fae1a63 in pfs_spawn_thread /11.3/src/storage/perfschema/pfs.cc:2201
    #14 0x7f25e4c44608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477
 
Indirect leak of 1344 byte(s) in 84 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4cfc81d  (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x9d81d)
    #2 0x3f935cb3a0bf9fff  (<unknown module>)
 
Indirect leak of 1176 byte(s) in 56 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4cf1ce9 in ASN1_STRING_set (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x92ce9)
 
Indirect leak of 224 byte(s) in 56 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4d2acdf in BUF_MEM_grow (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0xcbcdf)
 
Indirect leak of 128 byte(s) in 2 object(s) allocated from:
    #0 0x7f25e51d1808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x7f25e4ddac0d in CRYPTO_zalloc (/lib/x86_64-linux-gnu/libcrypto.so.1.1+0x17bc0d)
    #2 0x558c3f7f9fcb in vio_set_cert_stuff /11.3/src/vio/viosslfactories.c:157
    #3 0x558c3f7fb6be in new_VioSSLFd /11.3/src/vio/viosslfactories.c:408
    #4 0x558c3f7fbb42 in new_VioSSLAcceptorFd /11.3/src/vio/viosslfactories.c:496
    #5 0x558c3e5e1621 in init_ssl /11.3/src/sql/mysqld.cc:4710
    #6 0x558c3e5e5a26 in mysqld_main(int, char**) /11.3/src/sql/mysqld.cc:5884
    #7 0x558c3e5cd2cc in main /11.3/src/sql/main.cc:34
    #8 0x7f25e471a082 in __libc_start_main ../csu/libc-start.c:308
 
SUMMARY: AddressSanitizer: 279320 byte(s) leaked in 1718 allocation(s).


Generated at Thu Feb 08 10:29:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.