selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/3] Fix SELinux context mount with the cgroup filesystem
@ 2018-12-13 14:17 Ondrej Mosnacek
  2018-12-13 14:17 ` [RFC PATCH 1/3] cgroup: fix parsing empty mount option string Ondrej Mosnacek
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ondrej Mosnacek @ 2018-12-13 14:17 UTC (permalink / raw)
  To: selinux, Paul Moore, cgroups, Tejun Heo
  Cc: Stephen Smalley, Li Zefan, Johannes Weiner, Ondrej Mosnacek

This series contains three independent bugfixes that together make it possible
to mount the cgroup filesystem with the 'context=' option under SELinux.

The first patch is trivial and fixes cgroupfs to correctly handle the case when
the mount options are just an empty string.

The second patch fixes SELinux to always disallow relabeling inodes that
belong to a 'context=' mount.

The third patch fixes SELinux to ignore security_inode_notifysecctx() calls
on inodes that belong to a 'context=' mount.

Paul, Stephen, please have a quick look at the last two patches, I'm not 100%
sure that I understand the expected behavior of the context mounts correctly.
(My assumption is that in a context mount we want the whole subtree to be
labeled with the given label, no matter what.)

Also, I'm not entirely satisfied with the code style in the second patch (and
it produces an annoying false positive with checkpatch.pl), but I didn't see
a better way to write it...

I haven't had time to do much testing on the patches (other than the
reproducers mentioned in the commit messages). I'd like to make sure that
I'm going in the right direction first.

Thanks,

O.M.

--
Ondrej Mosnacek (3):
  cgroup: fix parsing empty mount option string
  selinux: never allow relabeling on context mounts
  selinux: do not override context on context mounts

 kernel/cgroup/cgroup.c   |  2 +-
 security/selinux/hooks.c | 48 ++++++++++++++++++++++++++++++----------
 2 files changed, 37 insertions(+), 13 deletions(-)

-- 
2.19.2


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

end of thread, other threads:[~2018-12-28 18:32 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-13 14:17 [RFC PATCH 0/3] Fix SELinux context mount with the cgroup filesystem Ondrej Mosnacek
2018-12-13 14:17 ` [RFC PATCH 1/3] cgroup: fix parsing empty mount option string Ondrej Mosnacek
2018-12-13 16:03   ` Tejun Heo
2018-12-28 15:14     ` Ondrej Mosnacek
2018-12-28 18:32       ` Tejun Heo
2018-12-13 14:17 ` [RFC PATCH 2/3] selinux: never allow relabeling on context mounts Ondrej Mosnacek
2018-12-13 16:18   ` Stephen Smalley
2018-12-18 15:38     ` Ondrej Mosnacek
2018-12-13 14:17 ` [RFC PATCH 3/3] selinux: do not override context " Ondrej Mosnacek
2018-12-13 16:27   ` Stephen Smalley
2018-12-18 15:50     ` Ondrej Mosnacek
2018-12-18 19:22       ` Stephen Smalley
2018-12-19 11:44         ` Ondrej Mosnacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).