From 8a4f098dee9056cec29366424d74ef78eea81184 Mon Sep 17 00:00:00 2001 From: Matthijs Mekking Date: Wed, 22 Dec 2021 16:53:30 +0100 Subject: [PATCH] Suppressing memory leaks procuded by LeakSanitizer These memory leaks are a known issue in libp11: From Timo Teras: The relevant code is: https://github.com/OpenSC/libp11/blob/master/src/eng_front.c#L114-L123 The authors of libp11 did not get the locking right and decided that having intentional memory leaks is better than risking a deadlock. The leak logs indicate that it is the cached structures that should have been freed. These are not a run-time leaks, so suppressing these leaks is probably okay. --- .gitlab-ci.yml | 1 + suppr-lsan.txt | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 suppr-lsan.txt diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 043968b93f..2816466c65 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -937,6 +937,7 @@ gcc:asan: system:gcc:asan: variables: SOFTHSM2_MODULE: "/lib64/libsofthsm2.so" + LSAN_OPTIONS: "suppressions=/builds/isc-projects/bind9/suppr-lsan.txt" <<: *fedora_35_amd64_image <<: *system_test_job needs: diff --git a/suppr-lsan.txt b/suppr-lsan.txt new file mode 100644 index 0000000000..050b86e9ae --- /dev/null +++ b/suppr-lsan.txt @@ -0,0 +1,26 @@ +# Copyright (C) Internet Systems Consortium, Inc. ("ISC") +# +# SPDX-License-Identifier: MPL-2.0 +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, you can obtain one at https://mozilla.org/MPL/2.0/. +# +# See the COPYRIGHT file distributed with this work for additional +# information regarding copyright ownership. + +# These are known leaks in libp11. +leak:BN_MONT_CTX_new +leak:C_LoadModule +leak:ctx_new +leak:ctx_try_load_object +leak:dlfcn_name_converter +leak:EC_GROUP_set_seed +leak:CRYPTO_strdup +leak:CRYPTO_zalloc +leak:pkcs11_check_token +leak:pkcs11_CTX_new +leak:pkcs11_enumerate_slots +leak:pkcs11_getattr_alloc +leak:pkcs11_init_key +leak:pkcs11_strdup