Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 859280

Summary: segfault in lookup_hosts.so (lib/rpc_subs.c:381)
Product: Red Hat Enterprise Linux 6 Reporter: Patrick J. LoPresti <lopresti>
Component: autofsAssignee: Ian Kent <ikent>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 6.3CC: ikent, slipcon
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-14 10:28:24 UTC Type: Bug
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 Flags
Patch to fix segfault in lookup_hosts.so none

Description Patrick J. LoPresti 2012-09-21 01:51:12 UTC
Created attachment 615205 [details]
Patch to fix segfault in lookup_hosts.so

Description of problem:

autofs can crash in lookup_hosts.so due to an uninitialized variable

Version-Release number of selected component (if applicable):
5.0.5-54

How reproducible:
Hard, but the bug is obvious when you look at the code (see attached patch).

Steps to Reproduce:
1. Try to "ls /net/foo" with flaky name servers
2. Hit Ctrl-C while command is hung
3. Check /var/log/messages to see automount segfaulted in lookup_hosts.so
  
Actual results:
Segfault

Expected results:
No segfault

Additional info:
The bug is in lib/rpc_subs.c:create_client(), which can fail to initailize *client.

Specifically, looking at the create_client() function...  If the call to rpc_do_create_client() inside the while loop never executes, then *client is never initialized, so the later check (!*client) and the invocation of clnt_control(*client,...) are accessing uninitialized data.  This can cause a crash depending on what happens to be on the stack at the time.

(In my case, create_client() itself is called from rpc_portmap_getclient(), which passes a pointer to an uninitialized stack variable as the "client" argument to create_client().  So *client really is uninitialized.)

I have a 24M core dump if you would like to see it.  Meanwhile I am attaching a quite trivial and obvious patch to fix the bug.

Comment 2 Ian Kent 2012-09-21 07:34:18 UTC
I believe that the package at:
http://people.redhat.com/~ikent/autofs-5.0.5-55.el6
will resolve your problem, please test it and let me know how
it goes.

Comment 3 Patrick J. LoPresti 2012-09-21 16:55:06 UTC
Yes, that does fix it (and some other issues besides).  Thank you!

Comment 4 Patrick J. LoPresti 2012-11-07 17:45:50 UTC
Just out of curiosity, are you folks planning to release an erratum?  This is a very nasty failure mode.

Comment 5 RHEL Program Management 2012-12-14 08:32:41 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 6 Ian Kent 2012-12-14 10:28:24 UTC
This issue should have been resolved in another bug in rhel-6.4.
If this is not the case please re-open this bug.