Re: [patch 00/13] vfs: add helpers to check r/o bind mounts

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Erez Zadok <ezk@...>
Cc: Miklos Szeredi <miklos@...>, <akpm@...>, <torvalds@...>, <dave@...>, <mhalcrow@...>, <linux-fsdevel@...>, <linux-kernel@...>
Date: Thursday, April 24, 2008 - 2:13 pm

On Thu, Apr 24, 2008 at 01:29:49PM -0400, Erez Zadok wrote:

Doesn't have anything to do with vfsmounts (you have one to deal with and
if it's r/o, it's equivalent to just doing the entire thing on top of r/o
fs; not interesting).

No, what I'm worried about is much simpler.  Look: we have a file on
underlying fs, owned by root.root with 644 for permissions.  Comes a
luser and tries to open the counterpart of that file in ecryptfs; that
triggers ecryptfs_interpose() and attempts to open file.  Of course,
that's going to fail - it's not world-writable.  So then it (actually
ecryptfs_init_persistent_file()) falls back to opening with O_RDONLY.
Which succeeds just fine and file (opened r/o) is set as ->lower_file.

Now comes root and tries to open the damn thing r/w.  It should be able
to and if it came first it'd get it; as it is, what it gets is ->lower_file
and that puppy is opened read-only and you have no guarantee that underlying
fs will not go bonkers seeing write attempts on it (e.g. open for write
doing a bit more setup of ->private_data, etc.).

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 7:39 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 12:58 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 10:09 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Al Viro, (Thu Apr 24, 2:13 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, J. Bruce Fields, (Mon Apr 28, 5:53 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Michael Halcrow, (Thu Apr 24, 4:16 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Michael Halcrow, (Thu Apr 24, 7:33 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 10:36 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 10:53 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 11:18 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 11:43 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 10:16 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 10:42 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 10:58 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 11:37 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Thu Apr 24, 12:16 pm)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Michael Halcrow, (Mon Apr 28, 10:20 am)
Re: [patch 00/13] vfs: add helpers to check r/o bind mounts, Miklos Szeredi, (Mon Apr 28, 10:52 am)