Description of problem: [root@dhcp59-192 ~]# strace -o /tmp/mount.strace -s 1024 -- mount -t ext3 -o loop,context=wrong_t /tmp/filesystem /import (return -EINVAL which is good) mount("/dev/loop0", "/import", "ext3", MS_MGC_VAL, "context=\"\"") = -1 EINVAL (Invalid argument) but look at the strace! the context options got shortened to just "" This was noticed because the kernel didn't expect to get just a blank, it expected there to be something there, even if it not valid. Most kernels return EINVAL (good) but some older ones can get more angry. This could be a bug in mount/libselinux/mcstransd or or maybe even something else I couldn't think of, but it is a bug. If mount finds out that a context is illegal it needs to either bail right then or it needs to pass along the wrong context to the kernel. It should not be truncating it to nothing. Just a point of information, if you use -o context=wrong_t:wrong_t:wrong_t (so actually a full user:role:type entry, even if there is a typo, mount send the context line to the kernel just fine. The only problem is when you don't have at least 2 ':' There is actually a security risk involved here. Because of the way NFS is handled by truncating the (wrong) context the kernel ends up believing you never specified a context at all. Thus we mount as if the option had never been given rather than failing with EINVAL.
wow, i got this assigned to the wrong component somehow....
reasigning to kzak, since i accidentally got the wrong component when i opened the BZ
relevant code in mount(8) (according to kzak) if (selinux_trans_to_raw_context( (security_context_t) data, &raw)==-1 || raw==NULL) return -1; and there is some debugging in mount which shows: mount: translated context= 'wrong_t' to '' so apparently selinux_trans_to_raw_context is returning a non-null string which is empty. In my opinion libselinux needs to be returning -EINVAL. Not just returning a blank string. Dan, sounds like this is being moved into your court....
This is a mcstrans bug, if you stop the service, the translation works correctly.
Changing version to '9' as part of upcoming Fedora 9 GA. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This message is a reminder that Fedora 9 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 9. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '9'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 9's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 9 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle. Changing version to '12'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
This message is a reminder that Fedora 12 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 12. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '12'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 12's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 12 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed.