From: "Richard W.M. Jones" <rjones@redhat.com>
To: Jason Zaman <jason@perfinion.com>
Cc: William Roberts <bill.c.roberts@gmail.com>,
SELinux <selinux@tycho.nsa.gov>
Subject: Re: [PATCH] libselinux: If autorelabel, force permissive mode.
Date: Thu, 7 Jul 2016 21:56:14 +0100 [thread overview]
Message-ID: <20160707205614.GA26165@redhat.com> (raw)
In-Reply-To: <20160707135017.GA23053@meriadoc.perfinion.com>
On Thu, Jul 07, 2016 at 09:50:17PM +0800, Jason Zaman wrote:
> Doesn't Android set the labels on the /system disk image during build?
> Maybe virt-builder can copy that? This would also speed up initial
> deployment of new images.
Well this is the real problem. Because the guest policy is a binary
blob, and because the binary blobs are not (necessarily) compatible
across kernel versions, we cannot just load the policy blob of the
guest into our kernel, so we cannot label guests properly. Sure be
nice if policy wasn't stored in this way.
> What steps are required during a default install in RHEL? does an
> install from a livecd without virt-builder also have this relabelling
> problem?
During a live CD install the live CD runs its own kernel. That's just
not the way virt-builder works. Also virt-builder customizes a
template, it doesn't build a whole VM from scratch (because that would
be orders of magnitude slower), so we start with whatever labels are
in the base template.
> One way I can think of is have a transition from kernel_t (or whatever
> the context would be on a completely unlabelled system) to a domain with
> perms to relabel everything. Since the labels would be missing pid1
> would have to runcon -t autorelabel_t ... but it seems the safer road
> than making absolutely everything permissive.
Note that /.autorelabel can be used at any time. The system is not
necessarily unlabelled, it is wrongly labelled.
> Alternatively, is there a reason /etc/selinux/config shouldn't be set to
> permissive by default in the image? What do we gain with this extra way?
> If the user is going to autorelabel after install, they are already
> probably setting permissive in the config before they reboot too.
As documented, the user can simply touch /.autorelabel and reboot to
autorelabel the system. They don't have to edit /etc/selinux/config
(and if they did, what would set it back to enforcing, and how would
that thing know what to set it back to?)
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines. Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v
next prev parent reply other threads:[~2016-07-07 20:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160707205614.GA26165@redhat.com \
--to=rjones@redhat.com \
--cc=bill.c.roberts@gmail.com \
--cc=jason@perfinion.com \
--cc=selinux@tycho.nsa.gov \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.