All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Paul Moore <paul@paul-moore.com>
Cc: Leesoo Ahn <lsahn@wewakecorp.com>,
	Casey Schaufler <casey@schaufler-ca.com>,
	linux-security-module@vger.kernel.org
Subject: Re: [LSM Stacking] SELinux policy inside container affects a process on Host
Date: Thu, 6 Jul 2023 19:35:47 -0500	[thread overview]
Message-ID: <20230707003547.GA507352@mail.hallyn.com> (raw)
In-Reply-To: <CAHC9VhRdCSJwB9hpyrCe+D00ddeRLisz=9GEWJz50ybr80tnsg@mail.gmail.com>

On Thu, Jul 06, 2023 at 09:43:01AM -0400, Paul Moore wrote:
> On Thu, Jul 6, 2023 at 1:20 AM Leesoo Ahn <lsahn@wewakecorp.com> wrote:
> >
> > Hello! Here is another weird behavior of lsm stacking..
> >
> > test env
> > - Ubuntu 23.04 Ubuntu Kernel v6.2 w/ Stacking patch v38
> > - boot param: lsm=apparmor,selinux
> > - AppArmor (Host) + SELinux (LXD Container Fedora 36)
> >
> > In the test environment mentioned above and applying selinux policy
> > enforcing by running "setenforce 1" within the container, executing the
> > following command on the host will result in "Permission denied" output.
> 
> SELinux operates independently of containers, or kernel namespacing in
> general.  When you load a SELinux policy it applies to all processes
> on the system, regardless of where they are in relation to the process
> which loaded the policy into the kernel.
> 
> This behavior is independent of the LSM stacking work, you should be
> able to see the same behavior even in cases where SELinux is the only

The real question might be what kind of container was this?  Since it
was allowed to setenforce 1, it must not have been in a user namespace?
Did you do "lxc config set c1 security.privileged true" ?

  reply	other threads:[~2023-07-07  0:35 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06  5:12 [LSM Stacking] SELinux policy inside container affects a process on Host Leesoo Ahn
2023-07-06 13:43 ` Paul Moore
2023-07-07  0:35   ` Serge E. Hallyn [this message]
2023-07-07  1:17     ` [LSM Stacking] SELinux policy inside container affects a processon Host Leesoo Ahn
2023-07-07  8:28   ` [LSM Stacking] SELinux policy inside container affects a process on Host Leesoo Ahn
2023-07-07 14:20     ` Paul Moore
2023-07-07 16:50       ` Casey Schaufler
2023-07-07 21:41         ` Paul Moore
2023-07-18 10:34         ` Dr. Greg
2023-07-18 17:20           ` Casey Schaufler
2023-07-19 18:45             ` Dr. Greg
2023-07-20  0:21               ` Casey Schaufler
2023-07-21 23:55                 ` Dr. Greg
2023-07-17 15:24       ` [LSM Stacking] SELinux policy inside container affects a processon Host Leesoo Ahn
2023-07-17 15:51         ` Casey Schaufler
2023-07-24  2:29           ` [LSM Stacking] SELinux policy inside container affects aprocesson Host Leesoo Ahn
2023-07-24 21:35             ` Casey Schaufler
2023-07-25  3:16               ` [LSM Stacking] SELinux policy inside container affects aprocessonHost Leesoo Ahn
2023-07-28  1:54       ` [LSM Stacking] SELinux policy inside container affects a processon Host Leesoo Ahn
2023-08-06 17:16         ` Dr. Greg
2023-08-06 19:25           ` Paul Moore
2023-08-08  6:40             ` Dr. Greg
2023-08-08 14:32               ` Paul Moore
2023-07-07 17:51     ` [LSM Stacking] SELinux policy inside container affects a process on Host Dr. Greg

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=20230707003547.GA507352@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=casey@schaufler-ca.com \
    --cc=linux-security-module@vger.kernel.org \
    --cc=lsahn@wewakecorp.com \
    --cc=paul@paul-moore.com \
    /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.