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 748412 - Memory leaks during the initgroups() operation
Summary: Memory leaks during the initgroups() operation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: sssd
Version: 6.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Stephen Gallagher
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: 750914
TreeView+ depends on / blocked
 
Reported: 2011-10-24 11:53 UTC by Jakub Hrozek
Modified: 2020-05-04 10:24 UTC (History)
9 users (show)

Fixed In Version: sssd-1.5.1-61.el6
Doc Type: Bug Fix
Doc Text:
Cause: SSSD didn't free some temporary memory in LDAP provider. Consequence: When running initgroups() operations, SSSD consumed extensive amount of memory, especially for complex membership structures. Fix: SSSD now frees memory in affected code. Result: SSSD memory consumption is as expected.
Clone Of:
Environment:
Last Closed: 2011-12-06 16:41:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
FedoraHosted SSSD 1055 0 None None None Never
Github SSSD sssd issues 2097 0 None closed Memory leaks in the LDAP provider 2020-05-04 10:24:20 UTC
Red Hat Product Errata RHBA-2011:1529 0 normal SHIPPED_LIVE sssd bug fix and enhancement update 2011-12-06 00:50:20 UTC

Description Jakub Hrozek 2011-10-24 11:53:26 UTC
Description of problem:
The LDAP provider of SSSD does not correctly release all memory during the initgroups() operation.


Version-Release number of selected component (if applicable):
sssd-1.5.1-60

How reproducible:
always

Steps to Reproduce:
1. configure a RFC2307bis LDAP domain
2. perform logins to trigger initgroups
  
Actual results:
sssd_be leaks memory

Expected results:
no leaks

Additional info:
The initgroups operation is performed as a part of every user login

Comment 1 Jenny Severance 2011-10-25 14:49:21 UTC
Please add steps complete steps to verify/reproduce Thanks

Comment 2 Jakub Hrozek 2011-10-25 16:13:12 UTC
1. configure and start SSSD
2. run "ps axo rss,comm | grep sssd_be" The output shold look something like this:
"4292 sssd_be", the number indicates the size of physical memory the process has allocated.
3. Perform initgroups:
   id -G $username
4. Check memory consumption after each initgroups operation. The number would still go up even with the patch, but with the affected packages, the number would increase much dramatically.

To exercise the affected branches of code, you can perform initgroups on users that are members of nested groups or users that are members of different groups that other users to force adding new groups into the cache on each initgroups operation.

Comment 4 Jan Zeleny 2011-10-27 11:39:52 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Cause: SSSD didn't free some temporary memory in LDAP provider.
Consequence: When running initgroups() operations, SSSD consumed extensive amount of memory, especially for complex membership structures.
Fix: SSSD now frees memory in affected code.
Result: SSSD memory consumption is as expected.

Comment 5 Kaushik Banerjee 2011-10-31 12:38:50 UTC
Verified in version:
# rpm -qi sssd | head
Name        : sssd                         Relocations: (not relocatable)
Version     : 1.5.1                             Vendor: Red Hat, Inc.
Release     : 63.el6                        Build Date: Wed 26 Oct 2011 09:12:47 PM IST
Install Date: Mon 31 Oct 2011 12:48:24 PM IST      Build Host: x86-002.build.bos.redhat.com
Group       : Applications/System           Source RPM: sssd-1.5.1-63.el6.src.rpm
Size        : 3615338                          License: GPLv3+
Signature   : (none)
Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL         : http://fedorahosted.org/sssd/
Summary     : System Security Services Daemon


Verified with valgrind that we no longer see the following leaks:
by 0xB12A09D: save_rfc2307bis_user_memberships (in /usr/lib64/sssd/libsss_ldap.so.1.0.0)


Also, the following comparisons were performed with earlier build:

With 1.5.1-60:

# ps axo rss,comm | grep sssd_be ------> After restarting sssd.
 3512 sssd_be
# ps axo rss,comm | grep sssd_be ------> id user8 (user8 is member of 2 level nested group)
 6324 sssd_be
# ps axo rss,comm | grep sssd_be ------> id user9 (user9 is member of 5 normal groups)
 6332 sssd_be
# ps axo rss,comm | grep sssd_be ------> id user10 (user10 is member of 2 level nested group)
 6336 sssd_be

With 1.5.1-63:

# ps axo rss,comm | grep sssd_be ------> After restarting sssd.
 3512 sssd_be
# ps axo rss,comm | grep sssd_be ------> id user8 (user8 is member of 2 level nested group)
 6180 sssd_be
# ps axo rss,comm | grep sssd_be ------> id user9 (user9 is member of 5 normal groups)
 6176 sssd_be
# ps axo rss,comm | grep sssd_be ------> id user10 (user10 is member of 2 level nested group)
 6184 sssd_be

Comment 6 errata-xmlrpc 2011-12-06 16:41:13 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHBA-2011-1529.html


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