All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Paris <eparis@parisplace.org>
To: Lennart Poettering <lennart@poettering.net>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
	systemd Mailing List <systemd-devel@lists.freedesktop.org>,
	SELinux-NSA <SELinux@tycho.nsa.gov>
Subject: Re: [systemd-devel] [PATCH] selinux: Only attempt to load policy exactly once, in the real root
Date: Thu, 20 Feb 2014 13:50:11 -0500	[thread overview]
Message-ID: <CACLa4ps3J9i8sSqxgrn6X=X08__rv4DWUPwYpeTPC-VcYBpjAQ@mail.gmail.com> (raw)
In-Reply-To: <20140220183643.GB24876@tango.0pointer.de>

Not really.  If it doesn't exist on the final root fs and I put
enforcing=1 on the command line, I expect the box to
panic/fail/die/whatever....

On Thu, Feb 20, 2014 at 1:36 PM, Lennart Poettering
<lennart@poettering.net> wrote:
> On Thu, 20.02.14 18:17, Colin Walters (walters@verbum.org) wrote:
>
> Hmm, maybe a simple check access("/etc/selinux/", F_OK) would be enough?
> There's no point in trying to initialized SELinux if that dir does not
> exist, right? Then we could simply bypass the whole thing...
>
>> On Thu, Feb 20, 2014 at 1:06 PM, Stephen Smalley <sds@tycho.nsa.gov>
>> wrote:
>> >
>> >Wouldn't it be better (and more correct) to probe both the
>> >initramfs and
>> >the real root, and if neither one can load policy successfully and
>> >enforcing=1, then halt?
>> >
>> So you're saying we should handle -ENOENT specially in the
>> initramfs?  Something like being sure we preserve errno and
>> returning it to the caller of selinux_init_load_policy()?  That
>> would introduce a subtle version dependency.
>>
>> Or alternatively, just try in the initramfs, ignore any errors, and
>> only abort if we also fail to load in the real root?
>>
>> I think both of these (particularly the second) are worse than my
>> patch - we don't (to my knowledge) support putting policy in the
>> initramfs now with Fedora or Red Hat Enterprise Linux, so attempting
>> to find it there by default on every bootup is wrong.
>>
>> To turn it around, what is the possible value in also probing the
>> initramfs?  Does anyone out there load policy from it with systemd?
>>
>
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
> _______________________________________________
> Selinux mailing list
> Selinux@tycho.nsa.gov
> To unsubscribe, send email to Selinux-leave@tycho.nsa.gov.
> To get help, send an email containing "help" to Selinux-request@tycho.nsa.gov.

  parent reply	other threads:[~2014-02-20 18:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 15:42 [PATCH] selinux: Only attempt to load policy exactly once, in the real root Colin Walters
2014-02-20 18:06 ` Stephen Smalley
2014-02-20 18:17   ` Colin Walters
2014-02-20 18:36     ` [systemd-devel] " Lennart Poettering
2014-02-20 18:47       ` Colin Walters
2014-02-20 18:50       ` Eric Paris [this message]
2014-02-20 19:26         ` Lennart Poettering
2014-02-20 19:27           ` Eric Paris
2014-02-20 19:45             ` Daniel J Walsh
2014-02-20 20:52               ` Colin Walters
2014-02-20 21:10                 ` Eric Paris
2014-02-20 21:21                   ` Colin Walters
2014-02-20 23:44                     ` Colin Walters
2014-02-21  2:33                       ` Lennart Poettering
2014-02-20 18:51     ` 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='CACLa4ps3J9i8sSqxgrn6X=X08__rv4DWUPwYpeTPC-VcYBpjAQ@mail.gmail.com' \
    --to=eparis@parisplace.org \
    --cc=SELinux@tycho.nsa.gov \
    --cc=lennart@poettering.net \
    --cc=sds@tycho.nsa.gov \
    --cc=systemd-devel@lists.freedesktop.org \
    /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.