Bug 125653
Summary: | segfaults when compat mode used in nsswitch.conf | ||||||
---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Paul Raines <raines> | ||||
Component: | pam | Assignee: | Tomas Mraz <tmraz> | ||||
Status: | CLOSED RAWHIDE | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 2 | CC: | mattdm, schwarz, t8m | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | All | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | 0.77-62 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2004-10-19 13:29:54 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Paul Raines
2004-06-09 18:06:48 UTC
Seems to affect only users that are in more than 8 groups The bug seems to actually be in the PAM compenent as I discovered it goes away if I remove the pam_succeed_if line from system-auth I've also found this. If the groups are in /etc/group it works but getting them from NIS is when the problem occurs. It looks like a problem in getgrouplist() and/or the libnss_compat functions. Here is a backtrace from a 'su - user' coredump: (gdb) bt #0 0x009c69f8 in getgrent_next_nss () from /lib/libnss_compat.so.2 #1 0x009c6726 in internal_getgrent_r () from /lib/libnss_compat.so.2 #2 0x009c6137 in _nss_compat_initgroups_dyn () from /lib/libnss_compat.so.2 #3 0x006b3565 in getgrouplist () from /lib/tls/libc.so.6 #4 0x00435a5d in pam_sm_authenticate () from /lib/security/../../lib/security/pam_succeed_if.so #5 0x000000c8 in ?? () #6 0x0892c070 in ?? () #7 0xfef2e600 in ?? () #8 0x00748780 in __after_morecore_hook () from /lib/tls/libc.so.6 #9 0x0892a2e8 in ?? () #10 0xfef2e5d4 in ?? () #11 0x0069273b in free () from /lib/tls/libc.so.6 Previous frame inner to this frame (corrupt stack?) I've also played with the example in the getgrouplist man page and found similar results. The example needs changed so *ng is > 0 and groups points to valid storage or the 2nd call will always coredump. By some chance, do any of your user accounts primary groups in NIS contain invalid characters such as a space? I was experiencing su segfaulting when querying LDAP users, who's primary group names contained spaces. After fixing the group names su would not segfault anymore. Nope, there are no spaces. There are names with uppercase, some with underscore and some longer than 8 chars. It works when the NIS groups are appended to /etc/group and the +: taken out. I also since tested changing /etc/nsswitch.conf from: group: compat to group: files nis and it will work correctly then also. Looks like the real problem is in _nss_compat_initgroups_dyn() in the library /lib/libnss_compat.so.2 which is part of glibc. Created attachment 103639 [details]
Proposed patch
The code calling getgrouplist in the pam module is unnecessary as the data it
obtains aren't used by the module anyway.
So I removed the call.
Hopefully the removed getgrouplist call will fix this. |