Red Hat Bugzilla – Bug 179437
mount -o remount,loop,context=... does not work
Last modified: 2008-08-02 19:40:32 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Description of problem:
Using the remount option with selinux context setting doesn't work.
'mount' reports that the mountpoint has the context, but I still
get selinux 'deny's.
I was also using the 'loop' option, I have not yet tested whether
this affects things at all.
Using umount then mount does work.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.mount a (loop) file system, then use a targeted subsystem, e.g. apache to
access and observe expected avc denies in /var/log/audit/audit.log
2. mount -o remount,loop,context=.... and observe the same avc denies again.
Actual Results: avc denys in /var/log/audit/audit.log
Expected Results: access should be permitted
can workaround with umount/mount -o loop,context=....
*** This bug has been marked as a duplicate of 186915 ***
Oops, I'm not sure if FC4 kernel really supports the "context" mount option. Can
anyone confirm it? The bug #186915 is against FC5. (Sorry for previous close as
I've used "fscontext" (not "context") in FC4 and that worked for me.
Hwoever, the context was only applied in-kernel and not available to userland,
so an "ls -lZ" of the mounted fs didn't show the context, unlike in FC5.
[This comment added as part of a mass-update to all open FC4 kernel bugs]
FC4 has now transitioned to the Fedora legacy project, which will continue to
release security related updates for the kernel. As this bug is not security
related, it is unlikely to be fixed in an update for FC4, and has been migrated
Please retest with Fedora Core 5.
A new kernel update has been released (Version: 2.6.18-1.2200.fc5)
based upon a new upstream kernel release.
Please retest against this new kernel, as a large number of patches
go into each upstream release, possibly including changes that
may address this problem.
This bug has been placed in NEEDINFO state.
Due to the large volume of inactive bugs in bugzilla, if this bug is
still in this state in two weeks time, it will be closed.
Should this bug still be relevant after this period, the reporter
can reopen the bug at any time. Any other users on the Cc: list
of this bug can request that the bug be reopened by adding a
comment to the bug.
In the last few updates, some users upgrading from FC4->FC5
have reported that installing a kernel update has left their
systems unbootable. If you have been affected by this problem
please check you only have one version of device-mapper & lvm2
installed. See bug 207474 for further details.
If this bug is a problem preventing you from installing the
release this version is filed against, please see bug 169613.
If this bug has been fixed, but you are now experiencing a different
problem, please file a separate bug for the new problem.
I can no longer test this because mount -o ...,remount, seems
to not like the context or fscontext options.
# mount | grep /mnt/l
/tmp/bug179437 on /mnt/l type ext3 (rw)
# mount -o loop,remount,rw /tmp/bug179437
# mount -o loop,remount,rw,context=system_u:object_r:etc_t \
mount: /mnt/l not mounted already, or bad option
In that sense it's fixed I guess, but it would be nice to
have a more explicit message about which option was 'bad'
adding some SELinux folks to the CC. Maybe they know more than I do about
whether or not this is supposed to work or not.
remounting with context= does not work (you really don't want it to anyway, due
to revocation issues).