* Re: FUSE merging? (2)
[not found] ` <4mwwX-3N9-9@gated-at.bofh.it>
@ 2005-07-04 13:09 ` Bodo Eggert
2005-07-04 13:17 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Bodo Eggert @ 2005-07-04 13:09 UTC (permalink / raw)
To: Miklos Szeredi, frankvm, miklos, frankvm, akpm, aia21, arjan,
linux-kernel
Miklos Szeredi <miklos@szeredi.hu> wrote:
> I see your point. But then this is really not a security issue, but
> an "are you sure you want to format C:" style protection for the
> user's own sake. Adding a mount option (checked by the library) for
> this would be fine. E.g. with "mount_nonempty" it would not refuse to
> mount on a non-leaf dir, and README would document, that using this
> option might cause trouble. Otherwise the mount would be refused with
> a reference to the above option.
IMO that should be a generic mount option, not FUSE specific.
Maybe the default could vary for each fs, but I'd vote against that.
--
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: FUSE merging? (2)
2005-07-04 13:09 ` FUSE merging? (2) Bodo Eggert
@ 2005-07-04 13:17 ` Miklos Szeredi
2005-07-04 15:19 ` Ragnar Kjørstad
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-04 13:17 UTC (permalink / raw)
To: 7eggert; +Cc: akpm, aia21, arjan, linux-kernel
> > I see your point. But then this is really not a security issue, but
> > an "are you sure you want to format C:" style protection for the
> > user's own sake. Adding a mount option (checked by the library) for
> > this would be fine. E.g. with "mount_nonempty" it would not refuse to
> > mount on a non-leaf dir, and README would document, that using this
> > option might cause trouble. Otherwise the mount would be refused with
> > a reference to the above option.
>
> IMO that should be a generic mount option, not FUSE specific.
> Maybe the default could vary for each fs, but I'd vote against that.
The option only makes sense with the default being restrictive. But
making that default for all filesystems can't be done, because that
would immediately break thousands of existing installations.
I think this makes some sense for unprivileged mounts, but otherwise
not really. If sysadmin is not careful about where the mounts go,
tough luck on him.
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging? (2)
2005-07-04 13:17 ` Miklos Szeredi
@ 2005-07-04 15:19 ` Ragnar Kjørstad
0 siblings, 0 replies; 10+ messages in thread
From: Ragnar Kjørstad @ 2005-07-04 15:19 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: 7eggert, akpm, aia21, arjan, linux-kernel
On Mon, Jul 04, 2005 at 03:17:35PM +0200, Miklos Szeredi wrote:
> > > I see your point. But then this is really not a security issue, but
> > > an "are you sure you want to format C:" style protection for the
> > > user's own sake. Adding a mount option (checked by the library) for
> > > this would be fine. E.g. with "mount_nonempty" it would not refuse to
> > > mount on a non-leaf dir, and README would document, that using this
> > > option might cause trouble. Otherwise the mount would be refused with
> > > a reference to the above option.
> >
> > IMO that should be a generic mount option, not FUSE specific.
> > Maybe the default could vary for each fs, but I'd vote against that.
Why a mount option at all?
Why not just a switch for the mount utility?
> The option only makes sense with the default being restrictive. But
> making that default for all filesystems can't be done, because that
> would immediately break thousands of existing installations.
I think it is acceptable to change this behaviour in a new version of
the mount utility. One could considder ignoring the restriction when
running with "-a" or when running as root - that would reduce or
eliminate the problems with the transition.
However, if this is implemented in mount itself, it is totally
orthogonal to the FUSE merge discussion.
--
Ragnar Kjørstad
Software Engineer
Scali - http://www.scali.com
Scaling the Linux Datacenter
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
@ 2005-07-01 13:05 Frank van Maarseveen
2005-07-01 13:21 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-01 13:05 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Fri, Jul 01, 2005 at 02:36:22PM +0200, Miklos Szeredi wrote:
> > > You mean suid programs are never to touch paths passed to them?
> >
> > never when euid==root.
> > The pathname could even point into /proc or anything else yet unknown,
> > e.g. by putting some symlinks at the right places. The mere act of
> > opening the file as root could have unwanted side effects already.
>
> OK, open is out. However other operations (stat, unlink, chmod etc)
> are always without side effects on "normal" filesystems. However on
> FUSE they are very much unsafe (can block, not do what was instructed
> and return success, etc).
What about tricking a setuid program to stat into /auto (/mnt/auto,
/misc, whatever it is called)? then the automounter will act upon a root
request with again possibly unwanted side effects. See how careful a
setuid/full-root program must be in handling userdata including pathnames?
FUSE suddenly makes this more obvious but it is not new.
> > > > - /proc isn't a problem: most root processes tend to avoid it because
> > > > it is synthetic and thus uninteresting. Maybe we should extend
> > > > the idea of "synthetic file-systems being uninteresting" to any
> > > > process which cannot receive signals from the FUSE mount owner. When
> > > > one cannot hide data by a FUSE mount and its synthetic anyway so not
> > > > interesting then just show the original empty mount point.
> > >
> > > Been there. People (like Al Viro) didn't like it.
> >
> > including changing the ptraceability test by a signal test and including
> > the (IMHO) required emptyness of the mount stub?
>
> It's been thrown out for the reason, that it's unacceptable if suid
> programs see a different namespace as non-suid.
You mean root versus non-root. or user versus other user I assume. Because
the euid (fsuid) is what matters.
But then: this _is_ already the case for NFS when squash_root is in effect
(what about kerberos et.al?). So there are several reasons to consider
FUSE a nonlocal fs instead of a local one so nothing new there. FUSE could
be used to implement a usable (not perfect) userspace NFS/ftp client.
To require an empty stub to mount FUSE upon makes the whole picture
cleaner: users are only able to extend the namespace _leaf_ nodes for
themselves and processes they can send signals to: setuid programs
which do not fully become root. The existing namespace [nodes] remains
unchanged for everyone.
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-01 13:05 FUSE merging? Frank van Maarseveen
@ 2005-07-01 13:21 ` Miklos Szeredi
2005-07-01 15:20 ` Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-01 13:21 UTC (permalink / raw)
To: frankvm; +Cc: akpm, aia21, arjan, linux-kernel
> > OK, open is out. However other operations (stat, unlink, chmod etc)
> > are always without side effects on "normal" filesystems. However on
> > FUSE they are very much unsafe (can block, not do what was instructed
> > and return success, etc).
>
> What about tricking a setuid program to stat into /auto (/mnt/auto,
> /misc, whatever it is called)? then the automounter will act upon a root
> request with again possibly unwanted side effects. See how careful a
> setuid/full-root program must be in handling userdata including pathnames?
I don't see why /auto is special. It's basically a userspace
filesystem too, but that's not what is specaial about FUSE. It's the
fact the it's a userspace filesystem controlled by an _ordinary user_.
> FUSE suddenly makes this more obvious but it is not new.
I believe it _is_ something new. If it were not, then your arguments
would be bulletproof. As it is, I think you miss the point that the
side effect is actually in the hands of the user invoking the suid
program, instead of something external.
> > > including changing the ptraceability test by a signal test and including
> > > the (IMHO) required emptyness of the mount stub?
> >
> > It's been thrown out for the reason, that it's unacceptable if suid
> > programs see a different namespace as non-suid.
>
> You mean root versus non-root. or user versus other user I assume. Because
> the euid (fsuid) is what matters.
Yes.
> But then: this _is_ already the case for NFS when squash_root is in effect
> (what about kerberos et.al?). So there are several reasons to consider
> FUSE a nonlocal fs instead of a local one so nothing new there. FUSE could
> be used to implement a usable (not perfect) userspace NFS/ftp client.
Yes. In fact even if the check were left out of the kernel, the
userspace filesystem could still return different data/error based on
fsuid/fsgid/pid.
So what's so controversial about it? I really fail to understand...
> To require an empty stub to mount FUSE upon makes the whole picture
> cleaner: users are only able to extend the namespace _leaf_ nodes for
> themselves and processes they can send signals to: setuid programs
> which do not fully become root. The existing namespace [nodes] remains
> unchanged for everyone.
It's not as simple. A filesystem can be mounted many times (either
with mount --bind, or just by mounting the same device on multiple
mountpoints). In this case you can't ensure, that a mountpoint will
remain a leaf node after being mounted on.
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-01 13:21 ` Miklos Szeredi
@ 2005-07-01 15:20 ` Frank van Maarseveen
2005-07-01 17:04 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-01 15:20 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Fri, Jul 01, 2005 at 03:21:59PM +0200, Miklos Szeredi wrote:
>
> > To require an empty stub to mount FUSE upon makes the whole picture
> > cleaner: users are only able to extend the namespace _leaf_ nodes for
> > themselves and processes they can send signals to: setuid programs
> > which do not fully become root. The existing namespace [nodes] remains
> > unchanged for everyone.
>
> It's not as simple. A filesystem can be mounted many times (either
> with mount --bind, or just by mounting the same device on multiple
> mountpoints). In this case you can't ensure, that a mountpoint will
> remain a leaf node after being mounted on.
I have bind-mounted / on /net/blabla
I tried two experiments:
mounting something under / and looking for it under /net/blabla
mounting something under /net/blabla and looking for it under /
The experiment was done with bind mounts and by mounting a USB stick
(/dev/sdb1) and there was no auto propagation of mounts.
(2.6.12-rc6)
How can a leaf dir suddenly become non-leaf by a mount without an explicit
mount command?
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-01 15:20 ` Frank van Maarseveen
@ 2005-07-01 17:04 ` Miklos Szeredi
2005-07-01 18:04 ` Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-01 17:04 UTC (permalink / raw)
To: frankvm; +Cc: akpm, aia21, arjan, linux-kernel
> > It's not as simple. A filesystem can be mounted many times (either
> > with mount --bind, or just by mounting the same device on multiple
> > mountpoints). In this case you can't ensure, that a mountpoint will
> > remain a leaf node after being mounted on.
>
> I have bind-mounted / on /net/blabla
> I tried two experiments:
>
> mounting something under / and looking for it under /net/blabla
> mounting something under /net/blabla and looking for it under /
>
> The experiment was done with bind mounts and by mounting a USB stick
> (/dev/sdb1) and there was no auto propagation of mounts.
I'm not talking about auto propagation (that's only now being
implemented by Ram Pai, and is not in stock kernels).
What I'm saying is that mounting something over a leaf node, does not
guarantee, that it will remain a leaf node after it's been mounted on.
For example:
mkdir /tmp/leafdir
mkdir /tmp/rootcopy
mount --bind / /tmp/rootcopy
mount /dev/sdb1 /tmp/leafdir
mkdir /tmp/rootcopy/tmp/leafdir/child
Now 'leafdir' is no longer a leaf.
I'm not saying this is a problem, but also I don't see any
overwhelming reason to not allow user mounts over non-leaf
directories.
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-01 17:04 ` Miklos Szeredi
@ 2005-07-01 18:04 ` Frank van Maarseveen
2005-07-02 14:49 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-01 18:04 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Fri, Jul 01, 2005 at 07:04:50PM +0200, Miklos Szeredi wrote:
> I'm not saying this is a problem, but also I don't see any
> overwhelming reason to not allow user mounts over non-leaf
> directories.
All things considered I'd still prefer forbidding FUSE mounts on non-leaf
dirs. For name space sanity. And it may be easier to get the whole thing
accepted:
- One could argue that the existing name space is extended rather than
changed [for a subset of processes], what Al Viro seems to reject.
- The processes which cannot be ptraced/sent a signal by the mount
owner are not "forced" to traverse the FUSE mount for the sake of
name space invariancy, with all associated security problems: they
can see everything up to the leaf node of all the usual mounts.
But put otherwise: is there a compelling reason to permit FUSE mounts on
non-leaf nodes?
Can FUSE mount on a file like NFS?
What is your opinion about replacing the ptrace check by a signal check
(later on, no hurry)?
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-01 18:04 ` Frank van Maarseveen
@ 2005-07-02 14:49 ` Miklos Szeredi
2005-07-02 16:00 ` Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-02 14:49 UTC (permalink / raw)
To: frankvm; +Cc: akpm, aia21, arjan, linux-kernel
> > I'm not saying this is a problem, but also I don't see any
> > overwhelming reason to not allow user mounts over non-leaf
> > directories.
>
> All things considered I'd still prefer forbidding FUSE mounts on non-leaf
> dirs. For name space sanity. And it may be easier to get the whole thing
> accepted:
>
> - One could argue that the existing name space is extended rather than
> changed [for a subset of processes], what Al Viro seems to reject.
> - The processes which cannot be ptraced/sent a signal by the mount
> owner are not "forced" to traverse the FUSE mount for the sake of
> name space invariancy, with all associated security problems: they
> can see everything up to the leaf node of all the usual mounts.
>
> But put otherwise: is there a compelling reason to permit FUSE mounts on
> non-leaf nodes?
Not really. Maybe it does have some uses, but I'm not aware of any.
But I don't think it would matter in the acceptance of the mount
hiding patch, since that patch was not rejected on the basis of what
FUSE would use it for, rather for the general philosophy of not
allowing namespace differences based on user id.
> Can FUSE mount on a file like NFS?
Yes.
> What is your opinion about replacing the ptrace check by a signal check
> (later on, no hurry)?
Maybe. You'd still have to convince me, that signals sent to suid
programs are not a security problem.
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-02 14:49 ` Miklos Szeredi
@ 2005-07-02 16:00 ` Frank van Maarseveen
2005-07-03 6:16 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-02 16:00 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Sat, Jul 02, 2005 at 04:49:24PM +0200, Miklos Szeredi wrote:
> >
> > All things considered I'd still prefer forbidding FUSE mounts on non-leaf
> > dirs. For name space sanity. And it may be easier to get the whole thing
> > accepted:
> >
>
> But I don't think it would matter in the acceptance of the mount
> hiding patch, since that patch was not rejected on the basis of what
> FUSE would use it for, rather for the general philosophy of not
> allowing namespace differences based on user id.
That would really be a loss.
After some thinking, the whole "not allowing namespace differences
based on user id" philosophy is unenforcable and not even true sometimes
nowadays. Think NFS: have a look at the unfsd server, you'll be surprised
what it can do. Think any other networked file system exported by a
machine with an unusual disk file-system underneath. IIRC ncpfs does
this on the server based on access and thus based on uid.
(hmm, I _hated_ it seeing empty directories only because I had no access
to anything below. Based on that I'd prefer EACCES instead of seeing an
empty mount stub when FUSE denies access to root or any other user.)
The thing is, root rules the _local_ part of the name space. So it should
make a _huge_ difference if FUSE can fiddle with that or only with what's
below the leaf nodes.
> > What is your opinion about replacing the ptrace check by a signal check
> > (later on, no hurry)?
>
> Maybe. You'd still have to convince me, that signals sent to suid
> programs are not a security problem.
google kill(2):
http://www.opengroup.org/onlinepubs/007908799/xsh/kill.html
It is _defined_ behavior. So, it is up to the quality of the programmer
whether or not it results in a security problem ;-)
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-02 16:00 ` Frank van Maarseveen
@ 2005-07-03 6:16 ` Miklos Szeredi
2005-07-03 11:25 ` Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-03 6:16 UTC (permalink / raw)
To: frankvm; +Cc: akpm, aia21, arjan, linux-kernel
> After some thinking, the whole "not allowing namespace differences
> based on user id" philosophy is unenforcable and not even true sometimes
> nowadays. Think NFS: have a look at the unfsd server, you'll be surprised
> what it can do. Think any other networked file system exported by a
> machine with an unusual disk file-system underneath. IIRC ncpfs does
> this on the server based on access and thus based on uid.
Hmm, do you mean returning different directory contents based on uid?
> (hmm, I _hated_ it seeing empty directories only because I had no access
> to anything below. Based on that I'd prefer EACCES instead of seeing an
> empty mount stub when FUSE denies access to root or any other user.)
Well, it works that way currently, and there doesn't seem to be any
real problem with it.
> The thing is, root rules the _local_ part of the name space. So it should
> make a _huge_ difference if FUSE can fiddle with that or only with what's
> below the leaf nodes.
I don't really understand what you mean by "local".
The problem with this leaf node philosophy, is that it's not really
consistent. You can ensure that a mountpoint is a leaf node at mount
time, but you can force it to remain a leaf node after the mount. So
I don't see why this check at mount time would make _any_ difference.
> > > What is your opinion about replacing the ptrace check by a signal check
> > > (later on, no hurry)?
> >
> > Maybe. You'd still have to convince me, that signals sent to suid
> > programs are not a security problem.
>
> google kill(2):
>
> http://www.opengroup.org/onlinepubs/007908799/xsh/kill.html
>
> It is _defined_ behavior. So, it is up to the quality of the programmer
> whether or not it results in a security problem ;-)
Ahh, right.
The info leak argument still holds, but it's pretty weak.
So if the current behavior causes a problem for sombody, and relaxing
the check from ptraceability to killability fixes it, then I'll
consider doing it. Until then, let's keep the more secure check.
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging?
2005-07-03 6:16 ` Miklos Szeredi
@ 2005-07-03 11:25 ` Frank van Maarseveen
2005-07-03 13:24 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-03 11:25 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Sun, Jul 03, 2005 at 08:16:37AM +0200, Miklos Szeredi wrote:
> > After some thinking, the whole "not allowing namespace differences
> > based on user id" philosophy is unenforcable and not even true sometimes
> > nowadays. Think NFS: have a look at the unfsd server, you'll be surprised
> > what it can do. Think any other networked file system exported by a
> > machine with an unusual disk file-system underneath. IIRC ncpfs does
> > this on the server based on access and thus based on uid.
>
> Hmm, do you mean returning different directory contents based on uid?
http://clusternfs.sourceforge.net
Don't ask me how this plays with the dcache.
> > The thing is, root rules the _local_ part of the name space. So it should
> > make a _huge_ difference if FUSE can fiddle with that or only with what's
> > below the leaf nodes.
>
> I don't really understand what you mean by "local".
The opposite of "local" is "remote", i.e. networked filesystems:
mount foo:/bar /usr/src/bar
/, /usr and /usr/src are stored on a local disk. /usr/src/bar/* is not.
Namespace invariance can be guaranteed for the "/usr/src" part. Not for
anything below unless you control the peer.
>
> The problem with this leaf node philosophy, is that it's not really
> consistent. You can ensure that a mountpoint is a leaf node at mount
> time, but you cannot force it to remain a leaf node after the mount. So
^^^
inserted by me
ok, I just remembered that any process with an open directory handle
could still fchdir() underneath. I think the leaf node enforcing is
possible but it is indeed a bit more complicated.
(Hmm, it's a bit bizarre but could you mount FUSE on, for example, a
named pipe and change it into a directory?)
> I don't see why this check at mount time would make _any_ difference.
It should be possible to do audits on local filesystems, e.g. by:
find / /home /var -xdev ....
This can be done as root but sometimes you may want to do this with the
uid/gid of a specific user, for safety or for checking what the user
actually can access or damage. And that won't work as expected when the
user places a FUSE mount on top of his own login directory. But I don't
think leaf node enforcing is required from a security point of view. This
is the only thing I could come up with.
IMHO The namespace argument against FUSE is weak for multiple reasons. The
only variancy I see is when crossing the mount point. And that disappears
once EACCES is returned when non-ptraceable processes try to cross it.
But that's not really acceptable (see previous audit case) unless FUSE
refuses to mount on non-leaf dirs.
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: FUSE merging?
2005-07-03 11:25 ` Frank van Maarseveen
@ 2005-07-03 13:24 ` Miklos Szeredi
2005-07-03 14:10 ` FUSE merging? (2) Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-03 13:24 UTC (permalink / raw)
To: frankvm; +Cc: akpm, aia21, arjan, linux-kernel
> > Hmm, do you mean returning different directory contents based on uid?
>
> http://clusternfs.sourceforge.net
>
> Don't ask me how this plays with the dcache.
But here the decision on what to return is in the _server_. There's
nothing magic about that. It's as if it was N different servers for N
different clients, only more effective.
> The opposite of "local" is "remote", i.e. networked filesystems:
>
> mount foo:/bar /usr/src/bar
>
> /, /usr and /usr/src are stored on a local disk. /usr/src/bar/* is not.
> Namespace invariance can be guaranteed for the "/usr/src" part. Not for
> anything below unless you control the peer.
I think what you call namespace invariance is basically true for all
existing filesystems. There could be a filesystem which returns
different directory contents based on whatever it wants, but it can't
return a different "dentry" for the same name.
So file/directory _content_ can be made to vary, but the namespace
itself can't.
> >
> > The problem with this leaf node philosophy, is that it's not really
> > consistent. You can ensure that a mountpoint is a leaf node at mount
> > time, but you cannot force it to remain a leaf node after the mount. So
> ^^^
> inserted by me
[well corrected :)]
>
> ok, I just remembered that any process with an open directory handle
> could still fchdir() underneath. I think the leaf node enforcing is
> possible but it is indeed a bit more complicated.
>
> (Hmm, it's a bit bizarre but could you mount FUSE on, for example, a
> named pipe and change it into a directory?)
No. Fusermount checks file type and refuses the mount if there's a
mismatch (and it protects against races by mounting on '.' for
directories, and on '/proc/self/fd/X' for regular files).
> > I don't see why this check at mount time would make _any_ difference.
>
> It should be possible to do audits on local filesystems, e.g. by:
>
> find / /home /var -xdev ....
>
> This can be done as root but sometimes you may want to do this with the
> uid/gid of a specific user, for safety or for checking what the user
> actually can access or damage.
But note, that running with the uid/gid of the user exposes the
auditing script to manipulation (kill, ptrace) by the user. Running
with changed fsuid/fsgid is OK though.
> And that won't work as expected when the user places a FUSE mount on
> top of his own login directory. But I don't think leaf node
> enforcing is required from a security point of view. This is the
> only thing I could come up with.
OK, from the auditing POV, there's a slight hole in unprivileged
mounts. But I don't think this is grave, since it's not so hard to
hide any sensitive data from such scripts anyway (keeping data in
memory, or keeping a file descriptor to an unlinked file, etc).
> IMHO The namespace argument against FUSE is weak for multiple reasons. The
> only variancy I see is when crossing the mount point. And that disappears
> once EACCES is returned when non-ptraceable processes try to cross it.
Yes, but still this is just a difference in permission, and not a
difference in namespace.
> But that's not really acceptable (see previous audit case) unless FUSE
> refuses to mount on non-leaf dirs.
I don't think the audit case is important. It's easy to work around
it manually by the sysadmin, and for the automatic case it doesn't
really matter (as detailed above).
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging? (2)
2005-07-03 13:24 ` Miklos Szeredi
@ 2005-07-03 14:10 ` Frank van Maarseveen
2005-07-03 15:47 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-03 14:10 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Sun, Jul 03, 2005 at 03:24:04PM +0200, Miklos Szeredi wrote:
>
> > But that's not really acceptable (see previous audit case) unless FUSE
> > refuses to mount on non-leaf dirs.
>
> I don't think the audit case is important. It's easy to work around
> it manually by the sysadmin, and for the automatic case it doesn't
> really matter (as detailed above).
Note that the audit case "as user" is less important than the root case. I
consider the latter very important and EACCES will break it when FUSE
permits mounting on non-leaf dirs.
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging? (2)
2005-07-03 14:10 ` FUSE merging? (2) Frank van Maarseveen
@ 2005-07-03 15:47 ` Miklos Szeredi
2005-07-03 19:36 ` Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-03 15:47 UTC (permalink / raw)
To: frankvm; +Cc: akpm, aia21, arjan, linux-kernel
> > > But that's not really acceptable (see previous audit case) unless FUSE
> > > refuses to mount on non-leaf dirs.
> >
> > I don't think the audit case is important. It's easy to work around
> > it manually by the sysadmin, and for the automatic case it doesn't
> > really matter (as detailed above).
>
> Note that the audit case "as user" is less important than the root case. I
> consider the latter very important and EACCES will break it when FUSE
> permits mounting on non-leaf dirs.
OK. Can you tell me, why you consider it important? And what's your
proposal for dealing with it?
Refusing to mount on non-leaf dir is not a solution, since it would
still allow arbitrary hiding.
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging? (2)
2005-07-03 15:47 ` Miklos Szeredi
@ 2005-07-03 19:36 ` Frank van Maarseveen
2005-07-04 8:56 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-03 19:36 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Sun, Jul 03, 2005 at 05:47:58PM +0200, Miklos Szeredi wrote:
> > > > But that's not really acceptable (see previous audit case) unless FUSE
> > > > refuses to mount on non-leaf dirs.
> > >
> > > I don't think the audit case is important. It's easy to work around
> > > it manually by the sysadmin, and for the automatic case it doesn't
> > > really matter (as detailed above).
> >
> > Note that the audit case "as user" is less important than the root case. I
> > consider the latter very important and EACCES will break it when FUSE
> > permits mounting on non-leaf dirs.
>
> OK. Can you tell me, why you consider it important? And what's your
> proposal for dealing with it?
It is important because on UNIX, "root" rules on local filesystems.
I dont't like the idea of root not being able to run "find -xdev" anymore
for administrative tasks, just because something got hidden by accident
or just for fun by a user. It's not about malicious users who want to
hide data: they can do that in tons of ways. The simple "find -xdev"
by root should just not be affected unless there is a very good reason
(SELinux or other "hardened" solutions).
IMHO The best thing FUSE could do is to make the mount totally invisible:
don't return EACCES, don't follow the FUSE mount but stay on the original
tree. I think it's either this or returning EACCES plus the leaf node
constraint at mount time.
The name-space variancy introduced by the first option is only minor:
Mounting anything over a tree which is still in use by a process is
much worse because it tends to be disruptive. And that has always been
possible.
[And I would use the kill() equivalence instead of ptrace() because it
is more appropriate. Doing so avoids the risk of accidentally breaking
useful setuid programs - I don't know if that will happen but I don't
see any security issues here.]
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging? (2)
2005-07-03 19:36 ` Frank van Maarseveen
@ 2005-07-04 8:56 ` Miklos Szeredi
2005-07-04 9:59 ` Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-04 8:56 UTC (permalink / raw)
To: frankvm; +Cc: akpm, aia21, arjan, linux-kernel
> It is important because on UNIX, "root" rules on local filesystems.
> I dont't like the idea of root not being able to run "find -xdev"
> anymore for administrative tasks, just because something got hidden
> by accident or just for fun by a user. It's not about malicious
> users who want to hide data: they can do that in tons of ways.
That's a sort of security by obscurity: if the user is dumb enough he
cannot do any harm. But I'm not interested in that sort of thing. If
this issue important, then it should be solved properly, and not just
by "preventing accidents".
> IMHO The best thing FUSE could do is to make the mount totally
> invisible: don't return EACCES, don't follow the FUSE mount but stay
> on the original tree. I think it's either this or returning EACCES
> plus the leaf node constraint at mount time.
The leaf node constranint doesn't make sense. The hidden mount thing
does, but it has been very flatly rejected by Al Viro.
There's a nice solution to this (discussed at length earlier): private
namespaces.
I think we are still confusing these two issues, which are in fact
separate.
1) polluting global namespace is bad (find -xdev issue)
2) not ptraceable (or not killable) processes should not be able to
access an unprivileged mount
For 1) private namespaces are the proper solution. For 2) the
fuse_allow_task() in it's current or modified form (to check
killability) should be OK.
1) is completely orthogonal to FUSE. 2) is currently provably secure,
and doesn't seem cause problems in practice. Do you have a concrete
example, where it would cause problems?
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: FUSE merging? (2)
2005-07-04 8:56 ` Miklos Szeredi
@ 2005-07-04 9:59 ` Frank van Maarseveen
2005-07-04 10:27 ` Miklos Szeredi
0 siblings, 1 reply; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-04 9:59 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Mon, Jul 04, 2005 at 10:56:30AM +0200, Miklos Szeredi wrote:
> > It is important because on UNIX, "root" rules on local filesystems.
> > I dont't like the idea of root not being able to run "find -xdev"
> > anymore for administrative tasks, just because something got hidden
> > by accident or just for fun by a user. It's not about malicious
> > users who want to hide data: they can do that in tons of ways.
>
> That's a sort of security by obscurity: if the user is dumb enough he
> cannot do any harm. But I'm not interested in that sort of thing. If
> this issue important, then it should be solved properly, and not just
> by "preventing accidents".
"solving it properly" refers to hardening the leaf node constraint
against circumvention I assume. Suppose there's a script for doing simple
on-line backups using "find". Now explain to the user why he lost his
data due to a backup script geting EACCES on a non-leaf FUSE mount. I
don't think that's acceptable. On the other hand, when the user stored
something _deliberately_ under a mountpoint, circumventing the leaf node
constraint by some trickery then it is clearly his own fault when the data
is lost. Anyway, a leaf node constraint can be hardened against misuse
later on, should it become necessary. Your bind-mount case to circumvent
this restriction is slightly flawed because it requires root interaction.
>
> There's a nice solution to this (discussed at length earlier): private
> namespaces.
I thought that's rejected because a process doesn't automatically get the
right namespace after rsh into such a machine? And fixing it by adjusting
the name-space of a process (by whatever means) is not transparent.
> I think we are still confusing these two issues, which are in fact
> separate.
>
> 1) polluting global namespace is bad (find -xdev issue)
>
> 2) not ptraceable (or not killable) processes should not be able to
> access an unprivileged mount
>
> For 1) private namespaces are the proper solution. For 2) the
> fuse_allow_task() in it's current or modified form (to check
> killability) should be OK.
>
> 1) is completely orthogonal to FUSE. 2) is currently provably secure,
> and doesn't seem cause problems in practice. Do you have a concrete
> example, where it would cause problems?
See above backup scenario.
Issues (1) and (2) are tied together I'm afraid:
When using a private name-space and thus assuming an unrelated process
needs to do something very special to get that name-space then (2)
would not be needed at all.
On the other hand, Name-space inheritance by setuid processes suddenly
becomes an issue: issue (2) is re-appearing but at another place.
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: FUSE merging? (2)
2005-07-04 9:59 ` Frank van Maarseveen
@ 2005-07-04 10:27 ` Miklos Szeredi
2005-07-04 11:26 ` Frank van Maarseveen
0 siblings, 1 reply; 10+ messages in thread
From: Miklos Szeredi @ 2005-07-04 10:27 UTC (permalink / raw)
To: frankvm; +Cc: miklos, frankvm, akpm, aia21, arjan, linux-kernel
> "solving it properly" refers to hardening the leaf node constraint
> against circumvention I assume. Suppose there's a script for doing simple
> on-line backups using "find". Now explain to the user why he lost his
> data due to a backup script geting EACCES on a non-leaf FUSE mount.
I see your point. But then this is really not a security issue, but
an "are you sure you want to format C:" style protection for the
user's own sake. Adding a mount option (checked by the library) for
this would be fine. E.g. with "mount_nonempty" it would not refuse to
mount on a non-leaf dir, and README would document, that using this
option might cause trouble. Otherwise the mount would be refused with
a reference to the above option.
Is that what you were thinking?
> > There's a nice solution to this (discussed at length earlier): private
> > namespaces.
>
> I thought that's rejected because a process doesn't automatically get the
> right namespace after rsh into such a machine? And fixing it by adjusting
> the name-space of a process (by whatever means) is not transparent.
Private namespaces in their current form are not really useful. But
that's irrelevant to the current discussion. If somebody needs
private namespaces they will have to add the missing features (Ram Pai
is working on shared subtrees, the biggest chunk).
> > I think we are still confusing these two issues, which are in fact
> > separate.
> >
> > 1) polluting global namespace is bad (find -xdev issue)
> >
> > 2) not ptraceable (or not killable) processes should not be able to
> > access an unprivileged mount
> >
> > For 1) private namespaces are the proper solution. For 2) the
> > fuse_allow_task() in it's current or modified form (to check
> > killability) should be OK.
> >
> > 1) is completely orthogonal to FUSE. 2) is currently provably secure,
> > and doesn't seem cause problems in practice. Do you have a concrete
> > example, where it would cause problems?
>
> See above backup scenario.
The backup problem is a consequence of 1). It has absolutely zero to
do with 2). If the fuse_allow_task() security check didn't exist the
backup script would still not work.
> Issues (1) and (2) are tied together I'm afraid:
>
> When using a private name-space and thus assuming an unrelated process
> needs to do something very special to get that name-space then (2)
> would not be needed at all.
Wrong. It's still needed, because suid/sgid programs can
- run under the private namespace without doing anything special
- run with extra privileges, not possesed by the user executing the
program
> On the other hand, Name-space inheritance by setuid processes suddenly
> becomes an issue: issue (2) is re-appearing but at another place.
I don't think you could change the rules of namespace inheritence,
without causing trouble.
Miklos
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: FUSE merging? (2)
2005-07-04 10:27 ` Miklos Szeredi
@ 2005-07-04 11:26 ` Frank van Maarseveen
0 siblings, 0 replies; 10+ messages in thread
From: Frank van Maarseveen @ 2005-07-04 11:26 UTC (permalink / raw)
To: Miklos Szeredi; +Cc: frankvm, akpm, aia21, arjan, linux-kernel
On Mon, Jul 04, 2005 at 12:27:13PM +0200, Miklos Szeredi wrote:
> E.g. with "mount_nonempty" it would not refuse to
> mount on a non-leaf dir, and README would document, that using this
> option might cause trouble. Otherwise the mount would be refused with
> a reference to the above option.
that will do.
--
Frank
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-07-04 15:20 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <4ly7J-14H-9@gated-at.bofh.it>
[not found] ` <4lRDA-4U-55@gated-at.bofh.it>
[not found] ` <4lSJa-16Z-7@gated-at.bofh.it>
[not found] ` <4m5ZG-2ok-1@gated-at.bofh.it>
[not found] ` <4maPM-5XJ-5@gated-at.bofh.it>
[not found] ` <4mcHV-7no-21@gated-at.bofh.it>
[not found] ` <4mduc-7Zg-1@gated-at.bofh.it>
[not found] ` <4mfcJ-UT-17@gated-at.bofh.it>
[not found] ` <4mitV-3mL-3@gated-at.bofh.it>
[not found] ` <4mv7Q-2Ki-19@gated-at.bofh.it>
[not found] ` <4mwdG-3AP-15@gated-at.bofh.it>
[not found] ` <4mwwX-3N9-9@gated-at.bofh.it>
2005-07-04 13:09 ` FUSE merging? (2) Bodo Eggert
2005-07-04 13:17 ` Miklos Szeredi
2005-07-04 15:19 ` Ragnar Kjørstad
2005-07-01 13:05 FUSE merging? Frank van Maarseveen
2005-07-01 13:21 ` Miklos Szeredi
2005-07-01 15:20 ` Frank van Maarseveen
2005-07-01 17:04 ` Miklos Szeredi
2005-07-01 18:04 ` Frank van Maarseveen
2005-07-02 14:49 ` Miklos Szeredi
2005-07-02 16:00 ` Frank van Maarseveen
2005-07-03 6:16 ` Miklos Szeredi
2005-07-03 11:25 ` Frank van Maarseveen
2005-07-03 13:24 ` Miklos Szeredi
2005-07-03 14:10 ` FUSE merging? (2) Frank van Maarseveen
2005-07-03 15:47 ` Miklos Szeredi
2005-07-03 19:36 ` Frank van Maarseveen
2005-07-04 8:56 ` Miklos Szeredi
2005-07-04 9:59 ` Frank van Maarseveen
2005-07-04 10:27 ` Miklos Szeredi
2005-07-04 11:26 ` Frank van Maarseveen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®