diff --git a/0021-ipa_cldap-fix-memory-leak.patch b/0021-ipa_cldap-fix-memory-leak.patch new file mode 100644 index 0000000..3c8109e --- /dev/null +++ b/0021-ipa_cldap-fix-memory-leak.patch @@ -0,0 +1,38 @@ +From 186ebe311bc9545d7a9860cd5e8c748131bbe41e Mon Sep 17 00:00:00 2001 +From: Francisco Trivino +Date: Thu, 10 Feb 2022 14:23:12 +0100 +Subject: [PATCH] ipa_cldap: fix memory leak + +ipa_cldap_encode_netlogon() allocates memory to store binary data as part of +berval (bv_val) when processing a CLDAP packet request from a worker. The +data is used by ipa_cldap_respond() but bv_val is not freed later on. + +This commit is adding the corresponding free() after ipa_cldap_respond() +is completed. + +Discovered by LeakSanitizer + +Fixes: https://pagure.io/freeipa/issue/9110 +Signed-off-by: Francisco Trivino +Reviewed-By: Alexander Bokovoy +Reviewed-By: Rob Crittenden +Reviewed-By: Thierry Bordaz +--- + daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_worker.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_worker.c b/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_worker.c +index db4a3d061..252bcf647 100644 +--- a/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_worker.c ++++ b/daemons/ipa-slapi-plugins/ipa-cldap/ipa_cldap_worker.c +@@ -287,6 +287,7 @@ done: + ipa_cldap_respond(ctx, req, &reply); + + ipa_cldap_free_kvps(&req->kvps); ++ free(reply.bv_val); + free(req); + return; + } +-- +2.34.1 + diff --git a/freeipa.spec b/freeipa.spec index 1cffad7..2ded5b6 100644 --- a/freeipa.spec +++ b/freeipa.spec @@ -198,7 +198,7 @@ Name: %{package_name} Version: %{IPA_VERSION} -Release: 3%{?rc_version:.%rc_version}%{?dist} +Release: 4%{?rc_version:.%rc_version}%{?dist} Summary: The Identity, Policy and Audit system License: GPLv3+ @@ -238,6 +238,7 @@ Patch0017: 0017-Don-t-always-override-the-port-in-import_included_pr.patch Patch0018: 0018-Remove-ipa-join-errors-from-behind-the-debug-option.patch Patch0019: 0019-Enable-the-ccache-sweep-timer-during-installation.patch Patch0020: 0020-Test-ipa-ccache-sweep.timer-enabled-by-default-durin.patch +Patch0021: 0021-ipa_cldap-fix-memory-leak.patch Patch1001: 1001-Change-branding-to-IPA-and-Identity-Management.patch %endif %endif @@ -1729,6 +1730,10 @@ fi %endif %changelog +* Mon Feb 14 2022 Alexander Bokovoy - 4.9.8-4 +- Resolves: rhbz#2053586 IPA LDAP plugin ipa-cldap memory leak + - fix memory leak in CLDAP responder + * Fri Feb 11 2022 Florence Blanc-Renaud - 4.9.8-3 - Resolves: rhbz#2050540 Unable to join RHEL 8.5 Replica to RHEL 7.9 Master for migration purposes - Don't always override the port in import_included_profiles