All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libselinux: If autorelabel, force permissive mode.
@ 2016-07-06  9:43 Richard W.M. Jones
  2016-07-06  9:43 ` Richard W.M. Jones
  2016-07-06 11:29 ` Jason Zaman
  0 siblings, 2 replies; 15+ messages in thread
From: Richard W.M. Jones @ 2016-07-06  9:43 UTC (permalink / raw)
  To: selinux

The autorelabel feature has been broken in Fedora for a while.
virt-builder relies on this feature to enable SELinux in guests since
we are unable to set filesystem labels when generating the image.  So
it comes down to me to try to fix this.  There was a discussion on the
Fedora development list which explains the background and the reasons
why autorelabel is broken:

http://thread.gmane.org/gmane.linux.redhat.fedora.devel/220453

The plan to fix autorelabel (also formulated in the above thread) is
in two parts:

(1) [This patch] If the autorelabel condition is detected when loading
policy very early during boot, we set SELinux to permissive mode
(overriding the contents of /etc/selinux/config and the command line).

(2) We install a systemd "generator".  If the autorelabel condition is
detected, then the generator redirects the default target to a new,
very minimal selinux-autorelabel.target.  This will relabel the
filesystem, remove /.autorelabel and reboot.  After the reboot the
system will boot normally, with correct filesystem labels and of
course with SELinux enabled.

During relabelling (unlike currently) only a very minimal set of
services are enabled, just enough to be able to mount the filesystem.
This should ensure there is no danger from having SELinux permissive
while relabelling.

This patch is actually against the fedora-selinux.git tree, although
it probably applies upstream too.

Rich.

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

end of thread, other threads:[~2016-07-13 19:50 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-06  9:43 [PATCH] libselinux: If autorelabel, force permissive mode Richard W.M. Jones
2016-07-06  9:43 ` Richard W.M. Jones
2016-07-06 11:29 ` Jason Zaman
2016-07-06 12:12   ` Richard W.M. Jones
2016-07-07 12:37     ` Sven Vermeulen
2016-07-07 12:43       ` William Roberts
2016-07-07 13:50         ` Jason Zaman
2016-07-07 13:52           ` William Roberts
2016-07-07 20:56           ` Richard W.M. Jones
2016-07-08  3:24             ` Russell Coker
2016-07-12 17:22             ` Stephen Smalley
2016-07-12 18:01               ` Richard W.M. Jones
2016-07-12 18:25                 ` Stephen Smalley
2016-07-13 19:31                   ` Richard W.M. Jones
2016-07-13 19:50                     ` Stephen Smalley

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.