All of lore.kernel.org
 help / color / mirror / Atom feed
* virtiofs and its optional xattr support vs. fs_use_xattr
@ 2020-12-07 14:42 Ondrej Mosnacek
  2020-12-07 15:03 ` Paul Moore
  2020-12-07 17:17 ` James Carter
  0 siblings, 2 replies; 26+ messages in thread
From: Ondrej Mosnacek @ 2020-12-07 14:42 UTC (permalink / raw)
  To: SElinux list
  Cc: Stephen Smalley, Paul Moore, Vivek Goyal, Daniel Walsh, Zdenek Pytela

Hi everyone,

In [1] we ran into a problem with the current handling of filesystem
labeling rules. Basically, it is only possible to specify either
genfscon or fs_use_xattr for a given filesystem, but in the case of
virtiofs, certain mounts may support security xattrs, while other ones
may not.

So we can't use the xattr support by adding fs_use_xattr virtiofs
(...); to the policy, because then a non-xattr mount will fail
(SELinux does a mount-time check on the root inode to make sure that
the xattr handler works), but we also don't want to stay on genfscon,
because then we can't relabel files.

So my question is how to best address this? One option is to use a
similar "hack" as for cgroupfs; i.e. do a kind of mixed genfs-xattr
labeling, but that's ugly and requires hard-coding another FS name in
the selinux code. The only other alternative I could come up with is
to add a new FS labeling statement that would specify some kind of
mixed genfscon / fs_use_xattr behavior. That would be a better
long-term solution, but leads to more questions on how such statement
should actually work... Should it work the cgroupfs way, giving a
default label to everything and allowing to set/change labels via
xattrs? Or should it rather just detect xattrs support and switch
between SECURITY_FS_USE_XATTR and SECURITY_FS_USE_GENFS behavior based
on that? In the latter case, should the statement specify two contexts
(one for fs_use_xattr and another one for genfscon) or just one for
both behaviors?

Any thoughts/pointers welcome.

[1] https://github.com/fedora-selinux/selinux-policy/pull/478

--
Ondrej Mosnacek
Software Engineer, Platform Security - SELinux kernel
Red Hat, Inc.


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2021-01-05 14:23 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07 14:42 virtiofs and its optional xattr support vs. fs_use_xattr Ondrej Mosnacek
2020-12-07 15:03 ` Paul Moore
2020-12-07 20:52   ` Vivek Goyal
2020-12-07 20:52     ` [Virtio-fs] " Vivek Goyal
2020-12-07 21:06     ` Harry G. Coin
2020-12-07 21:22     ` Dominick Grift
2020-12-07 21:22       ` [Virtio-fs] " Dominick Grift
2020-12-08 14:33       ` Vivek Goyal
2020-12-08 14:33         ` [Virtio-fs] " Vivek Goyal
2020-12-08 15:13         ` Dominick Grift
2020-12-08 15:13           ` [Virtio-fs] " Dominick Grift
2020-12-08 23:41     ` Paul Moore
2020-12-08 23:41       ` [Virtio-fs] " Paul Moore
2020-12-07 17:17 ` James Carter
2020-12-08 23:45   ` Paul Moore
2020-12-09 15:37     ` James Carter
2020-12-10  2:39       ` Paul Moore
2020-12-10  9:29         ` Ondrej Mosnacek
2020-12-10 22:17           ` Vivek Goyal
2020-12-10 22:24             ` Ondrej Mosnacek
2020-12-10 22:30               ` Vivek Goyal
2020-12-11  9:15                 ` Ondrej Mosnacek
2020-12-11 13:29                   ` Vivek Goyal
2021-01-04 20:14                   ` Vivek Goyal
2021-01-05 14:00                     ` Ondrej Mosnacek
2021-01-05 14:21                       ` Vivek Goyal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.