RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2032742 - IPA LDAP bind_and_check_pwp memory leak
Summary: IPA LDAP bind_and_check_pwp memory leak
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: 389-ds-base
Version: 8.5
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: 8.7
Assignee: Pierre Rogier
QA Contact: RHDS QE
URL:
Whiteboard: sync-to-jira
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-12-15 06:33 UTC by Marc Sauton
Modified: 2022-11-08 10:29 UTC (History)
7 users (show)

Fixed In Version: 389-ds-base-1.4.3.30-3.module+el8.7.0+15600+347cafc6
Doc Type: Bug Fix
Doc Text:
Cause: Some SASL contexts were not freed properly in somr error cases. Consequence: A moderate memory leak occurs during SASL bind when SASL library reports an error. Fix: That leak is now fixed. Result:
Clone Of:
Environment:
Last Closed: 2022-11-08 09:38:12 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 5126 0 None open Memory leak in slapi_ldap_get_lderrno 2022-03-29 13:03:28 UTC
Red Hat Issue Tracker IDMDS-1918 0 None None None 2022-01-13 17:21:45 UTC
Red Hat Issue Tracker IDMDS-2266 0 None None None 2022-05-09 08:13:00 UTC
Red Hat Issue Tracker RHELPLAN-105832 0 None None None 2021-12-15 06:35:21 UTC
Red Hat Product Errata RHBA-2022:7552 0 None None None 2022-11-08 09:38:51 UTC

Comment 1 Pierre Rogier 2022-01-07 15:24:32 UTC
The leak is due to a change in libldap API:
Digging in the old man page:
Note  LDAP_OPT_ERROR_STRING returns a pointer to an internal static string table, and ldap_memfree should not be called when using this session option.
And the new one:
LDAP_OPT_DIAGNOSTIC_MESSAGE
Sets/gets a string containing the error string associated to the LDAP handle. This option was formerly known as LDAP_OPT_ERROR_STRING. outvalue must be a char **, and the caller is responsible of freeing the returned string by calling ldap_memfree(3), while invalue must be a char *; the library duplicates the corresponding string.

So it looks like we will have to review the whole code for all slapi_ldap_get_lderrno calls:
  if the call has a message address it should be freed after use  by a call to a new slapi_ldap_free_lderrno_msg function
  that free the message if LDAP_OPT_DIAGNOSTIC_MESSAGE is defined.

Comment 6 thierry bordaz 2022-06-10 11:51:05 UTC
Fixed in 389-ds-base-1.4.3.30-3.module+el8.7.0+15600+347cafc6 => MODIFIED

Comment 10 Akshay Adhikari 2022-08-05 17:12:57 UTC
# PYTHONPATH=src/lib389/ py.test -v dirsrvtests/tests/suites/replication/sasl_m2_test.py
============================================================================ test session starts =================================================================
platform linux -- Python 3.6.8, pytest-7.0.1, pluggy-1.0.0 -- /usr/bin/python3.6
cachedir: .pytest_cache
389-ds-base: 1.4.3.30-4.1asan.el8
nss: 3.79.0-8.el8_6
nspr: 4.34.0-3.el8_6
openldap: 2.4.46-18.el8
cyrus-sasl: not installed
FIPS: disabled
rootdir: /root/389-ds-base/dirsrvtests, configfile: pytest.ini
collected 2 items                                                                                                                                                           

dirsrvtests/tests/suites/replication/sasl_m2_test.py::test_repl_sasl_md5_auth PASSED                                                                                  [ 50%]
dirsrvtests/tests/suites/replication/sasl_m2_test.py::test_repl_sasl_leak SKIPPED (Tescase using valgring cannot run on asan enabled build)                           [100%]

======================================================================= 1 passed, 1 skipped in 41.15s ============================================================

Marking it as VERIFIED.

Comment 12 errata-xmlrpc 2022-11-08 09:38:12 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (389-ds:1.4 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:7552


Note You need to log in before you can comment on or make changes to this bug.