All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Göttsche" <cgzones@googlemail.com>
To: SElinux list <selinux@vger.kernel.org>
Subject: Re: libselinux issue
Date: Tue, 31 Aug 2021 20:24:27 +0200	[thread overview]
Message-ID: <CAJ2a_Dc+YG0v3tMzXKYoFNfQykHwnhr9yE9+MxfAE1JTQSQ=Mw@mail.gmail.com> (raw)
In-Reply-To: <878s0hhlwp.fsf@defensec.nl>

On Tue, 31 Aug 2021 at 13:51, Dominick Grift <dominick.grift@defensec.nl> wrote:
>
> Dominick Grift <dominick.grift@defensec.nl> writes:
>
> > We can get into a state where selinux is enabled without a policy.
>

While testing a potential fix several questions came up:

I. What are the expected/desired outcomes after the following
configuration setups:

    * invalid SELINUX=, valid SELINUXTYPE=  (currently permissive,
except cmdline contains `enforcing=1` then system halt)
    * valid SELINUX=, invalid SELINUXTYPE=  (currently disabled if
SELINUX=disabled, system halt if SELINUX=enforcing or `enforcing=1`,
else zombie state)

II. When does the kernel considers SELinux to be *enabled*? After the
mount of a selinuxfs or after the first policy load?
    With SELinux being unable to disable at runtime in the near future
and SELinux being initialized after a selinuxfs mounting, that
probably needs selinux_init_load_policy(3) to check for a valid
SELINUXTYPE= before mounting a selinuxfs.

Also selinux_init_load_policy(3) libselinux should probably reset its
state via `umount(selinux_mnt); fini_selinuxmnt();` after a
selinux_mkload_policy(3) failure.

  reply	other threads:[~2021-08-31 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 11:45 libselinux issue Dominick Grift
2021-08-31 11:51 ` Dominick Grift
2021-08-31 18:24   ` Christian Göttsche [this message]
2021-09-02  9:28     ` Petr Lautrbach

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='CAJ2a_Dc+YG0v3tMzXKYoFNfQykHwnhr9yE9+MxfAE1JTQSQ=Mw@mail.gmail.com' \
    --to=cgzones@googlemail.com \
    --cc=selinux@vger.kernel.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.