All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Smalley <sds@tycho.nsa.gov>
To: Eric Paris <eparis@parisplace.org>
Cc: Daniel J Walsh <dwalsh@redhat.com>,
	SELinux <selinux@tycho.nsa.gov>,
	Lennart Poettering <lennart@poettering.net>
Subject: Re: libselinux mountpoint changing patch.
Date: Mon, 22 Aug 2011 13:33:22 -0400	[thread overview]
Message-ID: <1314034402.14217.119.camel@moss-pluto> (raw)
In-Reply-To: <CACLa4psD13cYBwzd0qQCa6Dh5JtAe3pdhbCSxROq85uXpyx9zw@mail.gmail.com>

On Mon, 2011-08-22 at 13:26 -0400, Eric Paris wrote:
> On Tue, May 3, 2011 at 11:33 AM, Stephen Smalley <sds@tycho.nsa.gov> wrote:
> > On Tue, 2011-05-03 at 10:50 -0400, Daniel J Walsh wrote:
> 
> >> NOTE:  We added the check for RO, to allow tools like mock to be able to
> >> tell a chroot that SELinux is disabled while enforcing it outside the
> >> chroot.
> >>
> >>
> >> # getenforce
> >> Enabled
> >> # mount -t selinuxfs -o remount,ro selinuxfs /var/chroot/selinux
> >
> > Just to clarify, the right commands to use are:
> > mount --bind /selinux /var/chroot/selinux
> > mount -o remount,ro /var/chroot/selinux
> >
> > Do not use:
> > mount -t selinuxfs -o ro selinuxfs /var/chroot/selinux
> > as this will in fact change the flags on /selinux as well.  Surprise!
> > Result of there only being a single instance (superblock) of selinuxfs,
> > although you can have multiple vfsmounts of it.
> 
> surprise, this doesn't work either!
> # cat mount.F16 | grep selinux
> mount --bind /selinux /mnt/F16/sys/fs/selinux/
> mount -o remount,ro /mnt/F16/sys/fs/selinux/
> 
> # cat /proc/mounts | grep selinux
> selinuxfs /selinux selinuxfs ro,relatime 0 0
> selinuxfs /mnt/F16/sys/fs/selinux selinuxfs ro,relatime 0 0
> 
> crap.

Hmmm...works for me on F14 (yeah, I know - ancient history).

# mkdir -p /var/chroot/selinux
# mount --bind /selinux /var/chroot/selinux
# mount -o remount,ro /var/chroot/selinux
# cat /proc/mounts | grep selinux
none /selinux selinuxfs rw,relatime 0 0
none /var/chroot/selinux selinuxfs ro,relatime 0 0
# echo 0 > /selinux/enforce
# echo 0 > /var/chroot/selinux/enforce 
bash: /var/chroot/selinux/enforce: Read-only file system

Did something change recently in the kernel or mount?

-- 
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2011-08-22 17:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-03 14:50 libselinux mountpoint changing patch Daniel J Walsh
2011-05-03 15:33 ` Stephen Smalley
2011-05-03 16:04   ` Daniel J Walsh
2011-05-03 16:53     ` Stephen Smalley
2011-05-03 17:13     ` Stephen Smalley
2011-05-03 18:06       ` Daniel J Walsh
2011-08-22 17:26   ` Eric Paris
2011-08-22 17:33     ` Stephen Smalley [this message]
2011-08-22 17:52       ` Eric Paris
2011-08-22 18:45         ` Stephen Smalley
2011-08-22 18:52           ` Eric Paris
2011-08-22 19:19             ` Daniel J Walsh
2011-08-22 19:22               ` Daniel J Walsh

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=1314034402.14217.119.camel@moss-pluto \
    --to=sds@tycho.nsa.gov \
    --cc=dwalsh@redhat.com \
    --cc=eparis@parisplace.org \
    --cc=lennart@poettering.net \
    --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.