Bug 439807

Summary: mount.nfs retries for 2 minutes when mount(2) returns -EACCES
Product: [Fedora] Fedora Reporter: Eric Paris <eparis>
Component: nfs-utilsAssignee: Steve Dickson <steved>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: jlayton
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-15 08:19:47 UTC Type: ---
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 (untested) none

Description Eric Paris 2008-03-31 15:00:10 UTC
mount server:/export /import/ -o
context=system_u:object_r:httpd_sys_content_t:s0,fscontext=system_u:object_r:lib_t:s0

With selinux enforcing this will give you an selinux denial and the actual mount
syscall returns -EACCES.  mount.nfs sleeps (increasingly longer up to 10
seconds) and keeps retrying.  One permission denied should be enough to cause
mount.nfs to give up.

A bit of an strace is below:
2262  mount("paris.rdu.redhat.com:/export/storage", "/storage", "nfs"..., 0,
"context=\"system_u:object_r:httpd_sys_content_t:s0\",fscontext=\"system_u:object_r:lib_t:s0\",addr=10.11.231.241"...)
= -1 EACCES (Permission denied)
2262  gettimeofday({1206974842, 167191}, NULL) = 0
2262  rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
2262  rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
2262  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
2262  nanosleep({1, 0}, {1, 0})         = 0
2262  mount("paris.rdu.redhat.com:/export/storage", "/storage", "nfs"..., 0,
"context=\"system_u:object_r:httpd_sys_content_t:s0\",fscontext=\"system_u:object_r:lib_t:s0\",addr=10.11.231.241"...)
= -1 EACCES (Permission denied)
2262  gettimeofday({1206974843, 206725}, NULL) = 0
2262  rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
2262  rt_sigaction(SIGCHLD, NULL, {SIG_DFL}, 8) = 0
2262  rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
2262  nanosleep({2, 0}, {2, 0})         = 0
2262  mount("paris.rdu.redhat.com:/export/storage", "/storage", "nfs"..., 0,
"context=\"system_u:object_r:httpd_sys_content_t:s0\",fscontext=\"system_u:object_r:lib_t:s0\",addr=10.11.231.241"...)
= -1 EACCES (Permission denied)

Comment 1 Eric Paris 2008-03-31 15:05:49 UTC
Correction, after 2 minutes of retrying it will give up.  Until recently this
will going up immediately.

Comment 2 Eric Paris 2008-03-31 15:08:07 UTC
I speak engrish goodly.

"Until recently this would give up immediately"

Comment 3 Jeff Layton 2008-03-31 15:13:56 UTC
Created attachment 299729 [details]
patch (untested)

This patch should fix it...

Comment 4 Eric Paris 2008-03-31 15:31:28 UTC
The patch works.  With it I get:

[root@dhcp231-25 ~]# mount paris.rdu.redhat.com:/export/storage /storage/ -o
context=system_u:object_r:httpd_sys_content_t:s0,fscontext=system_u:object_r:lib_t:s0
mount.nfs: access denied by server while mounting
paris.rdu.redhat.com:/export/storage

Which is not technically true.  The server didn't deny my, the local selinux
policy denied me.  But I'm happy with it anyway....

Comment 5 Steve Dickson 2008-03-31 22:34:57 UTC
So why was SELunix denying the mount?

Comment 6 Eric Paris 2008-04-01 01:28:14 UTC
In this particular case its because i told it to do something bogus with the
mount options.  The SELinux denial from the above line is expected and was
encountered when I was working on doing so SELinux/NFS testing for other
purposes.  Historically mount.nfs would kick it back at me instantly but not any
more.  This is not by any means common, a much more reasonable failure scenario
(and one that happened under binary mount options) would be:

mount server:/export /import -o context=system_u:object_r:httpd_t:s0

This is invalid but not nearly as strange and contrived as my previous mount
command and the user should get EACCES, but instead, after 2 minutes they get:

mount.nfs: Connection timed out

which does tell the real problem.  Even if we let it retry on EACCES for 2
minutes it needs to fail with EACCES.  If it pretends it was a timeout problem
it will send the user looking at non permission related problems...

Comment 7 Steve Dickson 2008-04-15 11:23:14 UTC
Fixed in nfs-utils-1.1.2-2

Comment 8 Bug Zapper 2008-05-14 08:28:29 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 9 Bug Zapper 2009-06-09 23:56:54 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 10 Bug Zapper 2009-07-15 08:19:47 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.