Bug 376061
Summary: | file labeling for /media(/[^/]*)? incorrect | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Philip Ashmore <contact> |
Component: | hal | Assignee: | Richard Hughes <rhughes> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | high | Docs Contact: | |
Priority: | low | ||
Version: | 10 | CC: | davidz, dwalsh, eparis, kzak, mclasen, sdsmall |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-12-18 06:00:26 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Philip Ashmore
2007-11-11 15:37:05 UTC
This is really a hal bug. Hal needs to either always mount these file systems as removable_t. Which would be a problem for file system like dosfs_t. And file systems with actual labels. I guess in the ideal situation, hal would somehow figure out if the file system is a file system that supports labels. If yes then check to see if it has labels on the root /? If not then mount it removable_t if yes then just mount it. Surely it would be nicer to make mount(8) do this... right? (hal just invokes mount(8) as uid 0). Alternatively we can teach hal to do this... (In reply to comment #1) > I guess in the ideal situation, hal would somehow figure out if the file system > is a file system that supports labels. If yes then check to see if it has > labels on the root /? If not then mount it removable_t if yes then just mount it. I don't know about any generic way how read xattr from non-mounted FS. It's unsupported by libvolume_id or libblkid. It means we need to mount it without any context, call getfilecon() and possibly *remount* it with context=removable_t. Does it make sense? I'm not sure if I good understand a relation between this request and bug #390691 where you ask for a warning message when a mounted FS is unlabeled. Or do you expect a different behaviour for the /media directory? Shouldn't be better to mount all unlabeled / non-xattr filesystems with context=removable_t ? We could simply always make hal mount file systems with xattr support as removable_t, but this would eliminate me being able to use labels on a removable device. Another option would be for hal or mount to check as you described above. Check the file context on mount, if it returns file_t, remount as removable_t. The mount command can give a warning that is described in the other bug, but hal can not. What about a kernel based solution? I mean a new mount(2) option -- something like a conditional context= for unlabeled / non-xattr filesystems. # mount /dev/flashdisk /media/foo -o condcontext=removable_t if the /dev/flashdisk is labeled the option is ignored otherwise it's mounted with context=removable_t. It looks like these are implementation questions, so it's not something I can contribute to. My two cents worth is that removable media shouldn't be labeled at all, it's the mount point that needs a label. Would it be useful to mount a device in different places to provide different contexts? I use rewritable media to back up and restore data. Steve and Eric your thoughts? (this kind of question likely belongs on selinux list) I would say that the default should be to mount removable media with a fixed label via a context mount, i.e. don't trust the attributes on the media even if present. Think of it being analogous to nosuid nodev. With suitable privileges, user may be able to mount removable media and use xattrs on it (if supported by the filesystem type). There is already a removable_context config file that contains the default context for such media, and libselinux exports its path via a function. Not sure who calls it at present - hal or mount? Ok since hal is the one mounting the removable media, it should probably just call the mount command with the correct mount option. And if you want to support removable media with file context you will need to override this behaviour. It looks like hal did this at one time in the past - I see mention of selinux removable context in the ChangeLog. But not in the current code? Reassigning to HAL. (for more details see comments #9, #10 -- most especially: "i.e. don't trust the attributes on the media even if present. Think of it being analogous to nosuid nodev.") So, is the outcome that hal should call mount with -o context=removable_t, always ? Yes well it should really use the contents of /etc/selinux/POLICY/contexts/removable_context Function call selinux_removable_context_path man selinux_removable_context_path ... extern const char *selinux_removable_context_path(void); ... selinux_removable_context_path() - filesystem context for removable media This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle. Changing version to '10'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping This message is a reminder that Fedora 10 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 10. 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 '10'. 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 10'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 10 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 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 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. |