Bug 248938 - mount -o ro,bind does not respect read only option
Summary: mount -o ro,bind does not respect read only option
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel   
(Show other bugs)
Version: 7
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-07-19 18:08 UTC by Bill C. Riemers
Modified: 2007-11-30 22:12 UTC (History)
4 users (show)

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


Attachments (Terms of Use)

Description Bill C. Riemers 2007-07-19 18:08:59 UTC
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 18:09:51 UTC
Step 4 should be:
ls -la /foo



Comment 2 Christopher Brown 2007-09-20 10:45:26 UTC
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 12:34:34 UTC
I can confirm it with 2.6.22.5-76.fc7

Comment 4 Bill C. Riemers 2007-09-20 13:14:31 UTC
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 13:55:58 UTC
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 15:09:01 UTC
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.