Re: ÐÑÐÐÑ: VFS, NFSsecurity bug? Should CAP_MKNOD and CAP_LINUX_IMMUTABLE be added toCAP_FS_MASK?

From: Stephen Smalley
Date: Wed Mar 18 2009 - 12:29:42 EST


On Tue, 2009-03-17 at 13:23 -0500, Serge E. Hallyn wrote:
> But in cap_inode_setxattr, any security.* xattrs are controlled by
> CAP_SYS_ADMIN. So do you think that this should be changed to a
> CAP_XATTR_SECURITY capability which can be added to CAP_FS_MASK?

I think that would be preferable to CAP_SYS_ADMIN, yes.

> Or do you think it's ok that fsuid=0 does not allow you to set
> security.selinux (or security.SMACK64, etc) xattrs when selinux is
> not compiled in?

Just to be clear, at present fsuid is irrelevant to setting the
security.* xattrs since it doesn't affect the CAP_SYS_ADMIN capability
at all, so it all depends on the initial capability state prior to using
setfsuid(), typically the full capability set.

> (You may have already answered this with your EOPNOTSUPP comment, but
> I want to make sure I understand right)
>
> > > Does anyone know what the trusted xattrs are used for?
> >
> > Not beyond what attr(5) says about them.
>
> Well, if attr(5) says CAP_SYS_ADMIN being needed is the very
> thing that defines these xattrs, then changing that seems a
> bigger deal. That really does seem akin to changing kernel-user
> API.

Perhaps, although it isn't clear that this API is in use by anyone or in
use in a way that would actually distinguish based on individual
capability.

But if you were to add CAP_SYS_ADMIN to CAP_FS_MASK in order to ensure
that setfsuid() does in fact affect all filesystem accesses, how much
meaningful difference remains between fsuid==0 and euid==0? It
obviously takes you far afield of only affecting filesystem accesses.

--
Stephen Smalley
National Security Agency

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/