Bug 248938 - mount -o ro,bind does not respect read only option
mount -o ro,bind does not respect read only option
Status: CLOSED UPSTREAM
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
7
All Linux
medium Severity medium
: ---
: ---
Assigned To: Eric Sandeen
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-19 14:08 EDT by Bill C. Riemers
Modified: 2007-11-30 17:12 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-09-20 11:09:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Bill C. Riemers 2007-07-19 14:08:59 EDT
Description of problem:

Even though the read only option is accepted for bind mounts, it does not work.
 Directories which are bind mounted as read only are still writable.  I believe
this feature use to work.

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


How reproducible:

Always

Steps to Reproduce:
1. mkdir -p /tmp/test
2. mount -o ro,bind / /tmp/test
3. touch /tmp/test/foo
4. ls -la /tmp/foo

  
Actual results:

foo is created in /tmp/test/foo and is shown in the ls command.

Expected results:

Either mount should complain that ro is an invalid option when used with bind,
or it should not be possible to create files in /tmp/test.

Additional info:
Comment 1 Bill C. Riemers 2007-07-19 14:09:51 EDT
Step 4 should be:
ls -la /foo

Comment 2 Christopher Brown 2007-09-20 06:45:26 EDT
Hello Bill,

I'm reviewing this bug as part of the kernel bug triage project, an attempt to
isolate current bugs in the fedora kernel.

http://fedoraproject.org/wiki/KernelBugTriage

I am CC'ing myself to this bug and will try and assist you in resolving it if I can.

There hasn't been much activity on this bug for a while. Could you tell me if
you are still having problems with the latest kernel?

If the problem no longer exists then please close this bug or I'll do so in a
few days if there is no additional information lodged.

Cheers
Chris
Comment 3 Matteo Corti 2007-09-20 08:34:34 EDT
I can confirm it with 2.6.22.5-76.fc7
Comment 4 Bill C. Riemers 2007-09-20 09:14:31 EDT
Yes.  The read only option is still ignored.  Perhaps the correct solution is
not to try and make the kernel respect the "ro" option, but to have mount give
an error when trying to use the "ro" option with a bind mount...

Bill
Comment 5 Christopher Brown 2007-09-20 09:55:58 EDT
Okay thanks Bill. I'm re-assigning to the filesystem maintainer and he may be
able to comment further.

Cheers
Chris
Comment 6 Chuck Ebbert 2007-09-20 11:09:01 EDT
The code to support read-only bind mounts is only now being reviewed, so this
won't be fixed until at least kernel 2.6.24.

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