selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix SELinux context mount with the cgroup filesystem
@ 2018-12-21 20:18 Ondrej Mosnacek
  2018-12-21 20:18 ` [PATCH v2 1/2] selinux: never allow relabeling on context mounts Ondrej Mosnacek
  2018-12-21 20:18 ` [PATCH v2 2/2] selinux: do not override context " Ondrej Mosnacek
  0 siblings, 2 replies; 8+ messages in thread
From: Ondrej Mosnacek @ 2018-12-21 20:18 UTC (permalink / raw)
  To: selinux, Paul Moore; +Cc: Stephen Smalley, Ondrej Mosnacek

This series contains two bugfixes that fix mounting the cgroup filesystem
with the 'context=' option under SELinux (and potentially other cases as well).

Changes in v2:
 - drop first patch (already picked up by cgroups maintainer)
 - extract the genfs special handling condition into a separate function
 - check for SBLABEL_MNT directly in selinux_inode_setsecurity() and in
   selinux_inode_notifysecctx() just translate -ENOTSUPP to 0
v1: https://lore.kernel.org/selinux/20181213141739.8534-1-omosnace@redhat.com/

Note that this series is testable only with patch [1] applied (it has already
been picked up by Tejun Heo, so I dopped it from this series).

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

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

Testing: Passed selinux-testsuite and verified using the reproducers.

[1] https://lore.kernel.org/selinux/20181213141739.8534-2-omosnace@redhat.com/

Ondrej Mosnacek (2):
  selinux: never allow relabeling on context mounts
  selinux: do not override context on context mounts

 security/selinux/hooks.c | 49 ++++++++++++++++++++++++++++++++--------
 1 file changed, 39 insertions(+), 10 deletions(-)

-- 
2.19.2


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

end of thread, other threads:[~2019-01-11  2:34 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-21 20:18 [PATCH v2 0/2] Fix SELinux context mount with the cgroup filesystem Ondrej Mosnacek
2018-12-21 20:18 ` [PATCH v2 1/2] selinux: never allow relabeling on context mounts Ondrej Mosnacek
2018-12-21 20:42   ` Stephen Smalley
2018-12-21 20:18 ` [PATCH v2 2/2] selinux: do not override context " Ondrej Mosnacek
2018-12-21 20:47   ` Stephen Smalley
2018-12-21 21:49     ` Ondrej Mosnacek
2018-12-21 22:59       ` Paul Moore
2019-01-11  2:28         ` Paul Moore

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).