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 1505647 - NSCD not properly caching netgroup
Summary: NSCD not properly caching netgroup
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: glibc
Version: 7.5
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: DJ Delorie
QA Contact: Sergey Kolosov
Vladimír Slávik
URL:
Whiteboard:
Depends On: 1436335
Blocks: 1477664 1505884
TreeView+ depends on / blocked
 
Reported: 2017-10-24 04:13 UTC by DJ Delorie
Modified: 2018-10-30 09:37 UTC (History)
13 users (show)

Fixed In Version: glibc-2.17-237.el7
Doc Type: Bug Fix
Doc Text:
`nscd` netgroups cache properly handles expiration Previously, when the `nscd` service was used to cache LDAP requests for netgroups, some entries in the cache might not expire correctly. As a consequence, the `nscd` cache did not reflect the service database correctly e.g. LDAP. The cache expiry code has been fixed, and changes in netgroups propagate to the cache correctly again.
Clone Of: 1436335
Environment:
Last Closed: 2018-10-30 09:36:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3092 0 None None None 2018-10-30 09:37:36 UTC
Sourceware 22342 0 None None None 2019-05-29 17:16:33 UTC

Comment 2 Carlos O'Donell 2018-02-27 17:27:25 UTC
Description of problem:
NSCD netgroup cache failure. Persistent cache inspection and logs show that setnetgrent() and innetgr() cache separate GETNETGRENT records in the cache. When the entry corresponding to innetgr() expires, on reload the netgroup entry has 0 results and further calls to innetgr always return 0 even if it should return 1. Debugging nscd, I found that innetgr adds the GETNETGRENT record to cache with the group string not null-terminated.

Version-Release number of selected component (if applicable):
glibc-2.17-196.el7

How reproducible:
always

Steps to Reproduce:
1. set up netgroups provided by ldap / nslcd
2. perform innetgr() with triplet that returns 1
3. wait for nscd debug log to show expire and reload of GETNETGRENT from innetgr()
4. perform innetgr() again, it returns 0

Actual results:
innetgr always returns 0 after GETNETGRENT record from previous innetgr() expires

Expected results:
innetgr should return 1 if entry is in netgroup or 0 if it is not

Additional info:
I've tested attached patch and it seems to work. One cache record exists from both setnetgrent() and innetgr(), and when it exires it reloads without issue. This has a side benefit of fewer type 19 records in nscd cache and fewer ldap lookup.

The proposed fix by Al Heisner <al> is:

--- netgroupcache.c	2017-03-27 12:49:39.833083147 -0400
+++ netgroupcache.c.patched	2017-03-27 12:49:25.797939129 -0400
@@ -484,7 +484,7 @@
 {
   const char *group = key;
   key = (char *) rawmemchr (key, '\0') + 1;
-  size_t group_len = key - group - 1;
+  size_t group_len = key - group; //include null terminator in size
   const char *host = *key++ ? key : NULL;
   if (host != NULL)
     key = (char *) rawmemchr (key, '\0') + 1;
---

This has to go upstream.

Comment 12 errata-xmlrpc 2018-10-30 09:36:35 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.

https://access.redhat.com/errata/RHSA-2018:3092


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