Bug 747038

Summary: Mount does not handle context mount correctly mount -t tmpfs none /tmp/foo -o context="system_u:object_r:tmp_t:s0:c127,c456"
Product: [Fedora] Fedora Reporter: Daniel Walsh <dwalsh>
Component: util-linuxAssignee: Karel Zak <kzak>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: berrange, eparis, jonathan, kzak, sdsmall
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: util-linux-2.20.1-2.2.fc16 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-28 03:25:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Daniel Walsh 2011-10-18 16:06:47 UTC
# strace -s 1024 -f mount -t tmpfs none /tmp/foo -o context="system_u:object_r:tmp_t:s0:c127,c456" 2> err
# fgrep 'mount(' err | tail -1
[pid  8959] mount("none", "/tmp/foo", "tmpfs", MS_MGC_VAL, "context=
\"system_u:object_r:tmp_t:s0:c127\",c456") = -1 EINVAL (Invalid
argument)

https://bugzilla.redhat.com/show_bug.cgi?id=219611

Reported and fixed this problem in RHEL5.

Comment 1 Daniel Berrangé 2011-10-18 16:37:22 UTC
The problem is that the above command is not quoted enough for the shell. Bash strips off your "  around the context, before the ARGV get to mount. So mount sees an ambiguous option string.

Double quoting works succesfully:

 mount -t tmpfs none /tmp/foo -o 'context="system_u:object_r:tmp_t:s0:c127,c456"'


This needs to be documented in the mount(8) man page for 'context', since it is very non-obvious what's going wrong.

Comment 2 Karel Zak 2012-01-10 14:46:51 UTC
Fixed by upstream commit 3142564b244b3163446d59f83390f73cea85097b. Fedora package will be updated ASAP.

Comment 3 Fedora Update System 2012-01-23 14:10:37 UTC
util-linux-2.20.1-2.2.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/util-linux-2.20.1-2.2.fc16

Comment 4 Fedora Update System 2012-01-23 21:52:34 UTC
Package util-linux-2.20.1-2.2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing util-linux-2.20.1-2.2.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0815/util-linux-2.20.1-2.2.fc16
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2012-01-28 03:25:01 UTC
util-linux-2.20.1-2.2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.