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 1612914 - [autofs]Removed entries still can be accessed
Summary: [autofs]Removed entries still can be accessed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: autofs
Version: 7.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ian Kent
QA Contact: Kun Wang
URL:
Whiteboard:
Depends On:
Blocks: 1613621
TreeView+ depends on / blocked
 
Reported: 2018-08-06 14:04 UTC by Kun Wang
Modified: 2018-10-30 11:42 UTC (History)
2 users (show)

Fixed In Version: autofs-5.0.7-95.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1613621 (view as bug list)
Environment:
Last Closed: 2018-10-30 11:41:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Patch - mark removed cache entry negative (2.17 KB, patch)
2018-08-07 10:14 UTC, Ian Kent
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:3283 0 None None None 2018-10-30 11:42:25 UTC

Description Kun Wang 2018-08-06 14:04:54 UTC
Description of problem:
This bug was found during I doing verification on Bug 1609128. PLZ refer to comment #24 and comment #27 of it.

Version-Release number of selected component (if applicable):
autofs-5.0.7-94.el7.x86_64

How reproducible:
always

Steps to Reproduce:

[root@hp-dl2x170g6-01 ~]# rpm -qa | grep autofs
autofs-5.0.7-94.el7.x86_64
[root@hp-dl2x170g6-01 ~]# cat /etc/auto.master
/n /etc/autofs/n -t 15
[root@hp-dl2x170g6-01 ~]# cat /etc/autofs/n                                                                           
nfs1 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test1
nfs2 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test2
nfs3 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test3
nfs4 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test4
[root@hp-dl2x170g6-01 ~]# service autofs restart
Redirecting to /bin/systemctl restart autofs.service
[root@hp-dl2x170g6-01 ~]# ls /n/nfs4
foo4 foo5 foo6 foo7
######################################################################
Now we comment out the nfs4
######################################################################
[root@hp-dl2x170g6-01 ~]# cat /etc/autofs/n                                                                           
nfs1 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test1
nfs2 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test2
nfs3 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test3
#nfs4 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test4
[root@hp-dl2x170g6-01 ~]# ls /n/nfs4
foo4 foo5 foo6 foo7
##########################################################################
do 'autofs reload' when it still mounted
#########################################################################
[root@hp-dl2x170g6-01 ~]# service autofs reload
Redirecting to /bin/systemctl reload autofs.service
######################################################################
now, the removed entry will persist....
around 1 hour later...(you should have noticed that I set '-t 15' in master map )
##########################################################################
[root@hp-dl2x170g6-01 ~]# ls /n/nfs4
foo4 foo5 foo6 foo7
[root@hp-dl2x170g6-01 ~]# cat /etc/autofs/n
nfs1 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test1
nfs2 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test2
nfs3 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test3
#nfs4 -rw,intr,hard intel-waimeabay-hedt-01.ml3.eng.bos.redhat.com:/test4
[root@hp-dl2x170g6-01 ~]# ls /n/nfs4
foo4 foo5 foo6 foo7

Actual results:
the removed entry still can be accessed

Expected results:
should not able to access. 

Additional info:

Comment 2 Ian Kent 2018-08-07 06:36:47 UTC
Requesting blocker flag as this has been reported as a result
of QE testing and the fix is simpler than I expected, so it
looks to be low risk to me.

I'll post the patch once I've done a little more testing.

Comment 3 Ian Kent 2018-08-07 10:14:35 UTC
Created attachment 1473944 [details]
Patch - mark removed cache entry negative

Comment 5 Kun Wang 2018-08-08 02:51:51 UTC
I tested on autofs-5.0.7-95.el7 for this bug.

The result shows that the removed entry won't be accessed after auto-umount. So this patch fixed this bug.

Comment 7 Kun Wang 2018-08-08 03:24:20 UTC
Now putting this BZ to verified state based on below test result:

#######################################################################
# on old version (autofs-5.0.7-94.el7), it failed                     #
#######################################################################
[22:42:19 root@ ~~]# service autofs reload
Redirecting to /bin/systemctl reload autofs.service
:: [ 22:42:19 ] :: [   PASS   ] :: Running 'service autofs reload' (Expected 0, got 0)
--------------------------------------------------------------------------------
[22:42:35 root@ ~~]# ls $nfsmp/$submp2
:: [ 22:42:35 ] :: [   FAIL   ] :: After reload removed entry shouldn't be accessable (Expected 2, got 0)

#######################################################################
# on fixed version (autofs-5.0.7-95.el7), it passed                   #
#######################################################################
[22:46:43 root@ ~~]# service autofs reload
Redirecting to /bin/systemctl reload autofs.service
:: [ 22:46:43 ] :: [   PASS   ] :: Running 'service autofs reload' (Expected 0, got 0)
--------------------------------------------------------------------------------
[22:47:03 root@ ~~]# ls $nfsmp/$submp2
ls: cannot access /mnt/nfsmp-bz1612914/NFS2: No such file or directory
:: [ 22:47:03 ] :: [   PASS   ] :: After reload removed entry shouldn't be accessable (Expected 2, got 2)

Comment 9 errata-xmlrpc 2018-10-30 11:41:29 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://access.redhat.com/errata/RHBA-2018:3283


Note You need to log in before you can comment on or make changes to this bug.