[PATCH 00/25] Read-only bind mounts

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <akpm@...>
Cc: <linux-kernel@...>, <hch@...>, Dave Hansen <haveblue@...>
Date: Thursday, September 20, 2007 - 3:52 pm

This is against 2.6.23-rc6.  Compared to 2.6.23-rc6-mm1, there
are a few (trivial) merge conflicts with the audit git tree,
and one slightly more complicated one with ext2-reservations.patch.

Changes from last post:
- added several kerneldoc comments for exported functions
- broke out the 'mnt' variable patch 
- removed WARN_ON() in ioctl patch

The first four patches here are very simple cleanups, and can go
in ahead of the rest of the patches.

If you are reviewing this, the things that need the most review
are the last two patches that actually add the logic for
tracking mount write counts.

---

Why do we need r/o bind mounts?

This feature allows a read-only view into a read-write filesystem.
In the process of doing that, it also provides infrastructure for
keeping track of the number of writers to any given mount.

This has a number of uses.  It allows chroots to have parts of
filesystems writable.  It will be useful for containers in the future
because users may have root inside a container, but should not
be allowed to write to somefilesystems.  This also replaces 
patches that vserver has had out of the tree for several years.

It allows security enhancement by making sure that parts of
your filesystem read-only (such as when you don't trust your
FTP server), when you don't want to have entire new filesystems
mounted, or when you want atime selectively updated.
I've been using the following script to test that the feature is
working as desired.  It takes a directory and makes a regular
bind and a r/o bind mount of it.  It then performs some normal
filesystem operations on the three directories, including ones
that are expected to fail, like creating a file on the r/o
mount.

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/25] Read-only bind mounts, Dave Hansen, (Thu Sep 20, 3:52 pm)
Re: [PATCH 24/25] r/o bind mounts: track number of mount wri..., Christoph Hellwig, (Mon Sep 24, 1:54 pm)
Re: [PATCH 24/25] r/o bind mounts: track number of mount wri..., Christoph Hellwig, (Mon Sep 24, 3:24 pm)
Re: [PATCH 24/25] r/o bind mounts: track number of mount wri..., Arjan van de Ven, (Mon Sep 24, 10:34 am)
[PATCH 25/25] honor r/w changes at do_remount() time, Dave Hansen, (Thu Sep 20, 3:53 pm)
[PATCH 23/25] do_rmdir(): elevate write count, Dave Hansen, (Thu Sep 20, 3:53 pm)
[PATCH 06/25] elevate write count open()'d files, Dave Hansen, (Thu Sep 20, 3:52 pm)
Re: [PATCH 06/25] elevate write count open()'d files, Andrew Morton, (Wed Nov 28, 4:41 am)
Re: [PATCH 06/25] elevate write count open()'d files, Dave Hansen, (Wed Nov 28, 1:33 pm)
[PATCH 19/25] elevate write count for do_utimes(), Dave Hansen, (Thu Sep 20, 3:53 pm)
[PATCH 02/25] rearrange may_open() to be r/o friendly, Dave Hansen, (Thu Sep 20, 3:52 pm)
[RFC] detect missed mnt_want_write() calls, Dave Hansen, (Tue Sep 25, 9:34 pm)
[PATCH 09/25] make access() use mnt check, Dave Hansen, (Thu Sep 20, 3:53 pm)
[PATCH 05/25] r/o bind mounts: stub functions, Dave Hansen, (Thu Sep 20, 3:52 pm)
[PATCH 04/25] create cleanup helper svc_msnfs(), Dave Hansen, (Thu Sep 20, 3:52 pm)
[PATCH 03/25] give may_open() a local 'mnt' variable, Dave Hansen, (Thu Sep 20, 3:52 pm)
Re: [PATCH 03/25] give may_open() a local 'mnt' variable, Christoph Hellwig, (Thu Sep 20, 3:57 pm)