Bug 1341908

Summary: rpc.mountd does not check for membership of IP addresses in netgroups if the IP is resolvable
Product: Red Hat Enterprise Linux 7 Reporter: Yongcheng Yang <yoyang>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED ERRATA QA Contact: Yongcheng Yang <yoyang>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: dwysocha, eguan, fsorenso, steved
Target Milestone: rcKeywords: Patch, TestCaseProvided
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: nfs-utils-1.3.0-0.29.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1231998 Environment:
Last Closed: 2016-11-04 05:04:05 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: 1231998    
Bug Blocks:    

Description Yongcheng Yang 2016-06-02 02:20:16 UTC
+++ This bug was initially created as a clone of Bug #1231998 +++

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 2 Yongcheng Yang 2016-06-02 02:27:08 UTC
According to bug 1231998 comment 10, need two 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 6 Yongcheng Yang 2016-06-12 01:58:38 UTC
Move to VERIFIED according to comment 5 and continue to run the automatic case.

Comment 8 errata-xmlrpc 2016-11-04 05:04:05 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-2383.html