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 1231998

Summary: rpc.mountd does not check for membership of IP addresses in netgroups if the IP is resolvable
Product: Red Hat Enterprise Linux 6 Reporter: Frank Sorenson <fsorenso>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.6CC: dwysocha, eguan, fsorenso
Target Milestone: rcKeywords: Patch, TestCaseProvided
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-1.2.3-67.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1341908 (view as bug list) Environment:
Last Closed: 2016-05-11 00:03:48 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:
Bug Depends On:    
Bug Blocks: 1172231, 1268411, 1341908    
Attachments:
Description Flags
initial version of patch
none
patch
none
patch to fix the regression none

Description Frank Sorenson 2015-06-15 19:18:58 UTC
Created attachment 1039200 [details]
initial version of patch

Description of problem:

If a netgroup entry specifies an IP address, and that IP address can be resolved to a name, the current match code only tests whether the canonical name and any aliases are in the netgroup, and does not test whether the IP address is in the netgroup.

If the IP address does not resolve to a name, the IP does get checked for membership in the netgroup, as expected.

As far as I can tell, this affects all versions of nfs-utils, including upstream.


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

nfs-utils-1.2.3-54.el6.x86_64 (though appears to affect all versions)


How reproducible:

reproducer below


Steps to Reproduce:

/etc/netgroup:
test_netgroup	(127.0.0.1,-,-)

/etc/exports:
/data2		@test_netgroup(rw,sync)

# mkdir /data2
# mkdir -p /mnt/test
# exportfs -a
# mount localhost:/data2 /mnt/test


Actual results:

mount.nfs: access denied by server while mounting localhost:/data2

(this will fail, assuming that there's a localhost entry in /etc/hosts)


Expected results:

mount succeeds


Additional info:

I took a first crack at a patch for support/export/client.c.  It works, but probably needs fixing.

Comment 5 Frank Sorenson 2015-10-22 21:07:26 UTC
Posted patch to linux-nfs

http://thread.gmane.org/gmane.linux.nfs/74669

Comment 6 Frank Sorenson 2015-10-27 01:15:45 UTC
Created attachment 1086677 [details]
patch

Comment 7 Steve Dickson 2015-12-02 16:53:14 UTC
(In reply to Frank Sorenson from comment #5)
> Posted patch to linux-nfs
> 
> http://thread.gmane.org/gmane.linux.nfs/74669

Unfortunately this patch causes the following regression
    https://bugzilla.redhat.com/show_bug.cgi?id=1284079

Comment 8 Frank Sorenson 2015-12-14 22:29:21 UTC
Follow-up patch to fix the regression posted to linux-nfs:

http://article.gmane.org/gmane.linux.nfs/75620

Comment 9 Frank Sorenson 2015-12-14 22:31:55 UTC
Created attachment 1105746 [details]
patch to fix the regression

Comment 10 Steve Dickson 2015-12-19 14:58:47 UTC
The two needed upstream commits:
commit 4b5bd85481a45957122357feebfcd514550fc219
Author: Frank Sorenson <sorenson>
Date:   Wed Dec 16 10:12:38 2015 -0500

    mountd: fix netgroup lookup for short hostnames

commit 9a92ef6f194926904b1289e0ce1daecb42bd5e8b
Author: Frank Sorenson <sorenson>
Date:   Mon Nov 2 08:31:29 2015 -0500

    mountd: fix netgroup lookup for resolvable IP addresses

Comment 18 Yongcheng Yang 2016-02-18 04:07:46 UTC
Move to VERIFIED as Comment 17

Comment 20 errata-xmlrpc 2016-05-11 00:03:48 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://rhn.redhat.com/errata/RHBA-2016-0868.html