Red Hat Bugzilla – 1198900 – Can mount a sub-directory disregarding the IP-restrict when the export has a wildcard and an IP-restricted submount export
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.
Description of problem:
When export a directory to be opened to all with "*" wildcard, and then export a sub-directory as IP-restricted, it seems that the restriction does not work, which means we can mount the sub-directory with a different IP
Version-Release number of selected component (if applicable):
RHEL-6.6 with nfs-utils-1.2.3-55.el6.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Edit the file /etc/export like:
/export *(rw)
/export/2 127.0.0.1(rw)
2. service nfs restart
3. Mount the /export/2/ from another machine or using the ipv6 address
Actual results:
[root@ibm-x3250m4-06 ~]# cat /etc/exports
/export *(rw)
/export.1 127.0.0.1(rw)
/export/2 127.0.0.1(rw)
[root@ibm-x3250m4-06 ~]# service nfs restart
Shutting down NFS daemon: [ OK ]
Shutting down NFS mountd: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Shutting down RPC idmapd: [ OK ]
Starting NFS services: exportfs: scandir /etc/exports.d: No such file or directory
[ OK ]
Starting NFS quotas: [ OK ]
Starting NFS mountd: [ OK ]
Starting NFS daemon: [ OK ]
Starting RPC idmapd: [ OK ]
[root@ibm-x3250m4-06 ~]# showmount -e
Export list for ibm-x3250m4-06.rhts.eng.nay.redhat.com:
/export *
/export/2 127.0.0.1
/export.1 127.0.0.1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ above 2 dir only export for 127.0.0.1
[root@ibm-x3250m4-06 ~]# hostname
ibm-x3250m4-06.rhts.eng.nay.redhat.com
[root@ibm-x3250m4-06 ~]# touch /export/2/test
[root@ibm-x3250m4-06 ~]#
[root@ibm-x3250m4-06 ~]# rpm -q nfs-utils
nfs-utils-1.2.3-55.el6.x86_64
[root@ibm-x3250m4-06 ~]#
==================
On another machine
==================
[root@hp-dl380pg8-01 ~]# hostname
hp-dl380pg8-01.rhts.eng.pek2.redhat.com
[root@hp-dl380pg8-01 ~]#
[root@hp-dl380pg8-01 ~]# mount ibm-x3250m4-06.rhts.eng.nay.redhat.com:/export /mnt/mnt_export
[root@hp-dl380pg8-01 ~]# mount ibm-x3250m4-06.rhts.eng.nay.redhat.com:/export.1/ /mnt/mnt_export.1/
mount.nfs: access denied by server while mounting
ibm-x3250m4-06.rhts.eng.nay.redhat.com:/export.1/
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It failed as expected
[root@hp-dl380pg8-01 ~]# mount ibm-x3250m4-06.rhts.eng.nay.redhat.com:/export/2/ /mnt/mnt_export.2/
[root@hp-dl380pg8-01 ~]# echo $?
0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Should fail but successed
[root@hp-dl380pg8-01 ~]# nfsstat -m
/mnt/mnt_export from ibm-x3250m4-06.rhts.eng.nay.redhat.com:/export/
Flags: rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.254,minorversion=0,local_lock=none,addr=10.66.87.51
/mnt/mnt_export.2 from ibm-x3250m4-06.rhts.eng.nay.redhat.com:/export/2
Flags: rw,relatime,vers=4,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.73.4.254,minorversion=0,local_lock=none,addr=10.66.87.51
[root@hp-dl380pg8-01 ~]# ls /mnt/mnt_export.2/
test
[root@hp-dl380pg8-01 ~]#
Expected results:
should echo "mount.nfs: access denied by server while mounting"
Red Hat Enterprise Linux 6 is in the Production 3 Phase. During the Production 3 Phase, Critical impact Security Advisories (RHSAs) and selected Urgent Priority Bug Fix Advisories (RHBAs) may be released as they become available.
The official life cycle policy can be reviewed here:
http://redhat.com/rhel/lifecycle
This issue does not meet the inclusion criteria for the Production 3 Phase and will be marked as CLOSED/WONTFIX. If this remains a critical requirement, please contact Red Hat Customer Support to request a re-evaluation of the issue, citing a clear business justification. Note that a strong business justification will be required for re-evaluation. Red Hat Customer Support can be contacted via the Red Hat Customer Portal at the following URL:
https://access.redhat.com/