From: "Richard W.M. Jones" <rjones@redhat.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Jason Zaman <jason@perfinion.com>, SELinux <selinux@tycho.nsa.gov>
Subject: Re: [PATCH] libselinux: If autorelabel, force permissive mode.
Date: Tue, 12 Jul 2016 19:01:07 +0100 [thread overview]
Message-ID: <20160712180107.GQ16797@redhat.com> (raw)
In-Reply-To: <489b58fb-1fad-2456-67bd-8e88f9e8a16d@tycho.nsa.gov>
On Tue, Jul 12, 2016 at 01:22:55PM -0400, Stephen Smalley wrote:
> On 07/07/2016 04:56 PM, Richard W.M. Jones wrote:
> > 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.
>
> Just to clarify, it is not necessary to load the guest policy into the
> host kernel in order to set labels on the guest filesystem. SELinux
> long ago introduced support for setting foreign/unknown labels on files
> by processes with the appropriate permissions, and that mechanism was
> used by livecd creator IIRC - it was also intended for use by rpm for
> labeling files before the corresponding policy module was installed but
> they never took advantage of it.
IME you cannot set any label unless SELinux is enabled in the
appliance kernel, but even assuming this is really possible, how do
you know what label should you set? Really we just want to do
"restorecon -R /" but that has proven to be impossible.
> The other approach would be to follow what we did in Android, i.e.
> extend the filesystem generation tools to look up the appropriate
> context and set the xattr when generating the image files. Similar
> support was also recently added to the OpenEmbedded tools for labeling
> those images.
Look up how?
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
next prev parent reply other threads:[~2016-07-12 18:01 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
2016-07-08 3:24 ` Russell Coker
2016-07-12 17:22 ` Stephen Smalley
2016-07-12 18:01 ` Richard W.M. Jones [this message]
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=20160712180107.GQ16797@redhat.com \
--to=rjones@redhat.com \
--cc=jason@perfinion.com \
--cc=sds@tycho.nsa.gov \
--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.