Bug 877715
Summary: | selinux access problems | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] oVirt | Reporter: | cristi falcas <cristi.falcas> | ||||
Component: | vdsm | Assignee: | Federico Simoncelli <fsimonce> | ||||
Status: | CLOSED ERRATA | QA Contact: | Haim <hateya> | ||||
Severity: | medium | Docs Contact: | |||||
Priority: | urgent | ||||||
Version: | 3.2 | CC: | abaron, acathrow, amureini, bazulay, dwalsh, dyasny, fsimonce, iheim, mgoldboi, teigland, yeylon, ykaul | ||||
Target Milestone: | --- | ||||||
Target Release: | 3.3.4 | ||||||
Hardware: | x86_64 | ||||||
OS: | Linux | ||||||
Whiteboard: | storage | ||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | |||||||
: | 879899 (view as bug list) | Environment: | |||||
Last Closed: | 2013-02-27 23:24:04 UTC | Type: | Bug | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | Storage | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Bug Depends On: | |||||||
Bug Blocks: | 879899, 905192 | ||||||
Attachments: |
|
Description
cristi falcas
2012-11-18 09:58:42 UTC
Can you report the components version: fedora release (fc17/18), selinux-policy version. What's the sebool status? # getsebool -a | egrep "(sanlock_use|virt_use_sanlock)" On fedora 18 this is not specific to sanlock, for what I see the method we currently use to set the sebool options is broken, in fact also other booleans are not set: virt_use_nfs --> off virt_use_sanlock --> off sanlock_use_nfs --> off The issue I'm hitting is: # semanage boolean -l | grep virt_use_nfs Traceback (most recent call last): File "/usr/sbin/semanage", line 25, in <module> import seobject File "/usr/lib64/python2.7/site-packages/seobject.py", line 30, in <module> import sepolgen.module as module ImportError: No module named sepolgen.module (Failure within the pre scriptlet in the spec file) This is on fedora 17 Packages versions: rpm -qa | grep selinux libselinux-2.1.10-3.fc17.i686 libselinux-python-2.1.10-3.fc17.x86_64 libselinux-2.1.10-3.fc17.x86_64 libselinux-utils-2.1.10-3.fc17.x86_64 selinux-policy-targeted-3.10.0-159.fc17.noarch selinux-policy-devel-3.10.0-159.fc17.noarch selinux-policy-3.10.0-159.fc17.noarch sebool: getsebool -a | egrep "(sanlock_use|virt_use_sanlock)" sanlock_use_fusefs --> off sanlock_use_nfs --> on sanlock_use_samba --> off virt_use_sanlock --> on Daniel do you think it would be possible to grant open, read and write permissions to sanlock for public_content_rw_t? Will you add a new boolean for that? /media/ceva2/Ovirt/Storage/7274c859-af87-4b43-8e2a-575bf12ca395/dom_md/leases is labeled public_content_rw_t? Why is that? What content is in these directories? I see this content with no labels on it? (In reply to comment #4) > /media/ceva2/Ovirt/Storage/7274c859-af87-4b43-8e2a-575bf12ca395/dom_md/leases > is labeled public_content_rw_t? > > Why is that? What content is in these directories? > > I see this content with no labels on it? /media/ceva2/Ovirt/Storage/7274c859-af87-4b43-8e2a-575bf12ca395 contains a set of files (and directories) that should be accessed by vdsm (eg: metadata), qemu (eg: vm images) and sanlock (eg: leases). None of those require public_content, This is used for apache/ftp files not images. IMages should be labeled virt_image_t. leases should probably be labeled sanlock_var_run_t. Not sure what label vdsm runs with virtd_t? Created attachment 661550 [details] 0001-Add-proper-label-for-sanlock-leases.patch (In reply to comment #6) > None of those require public_content, This is used for apache/ftp files not > images. > > IMages should be labeled virt_image_t. leases should probably be labeled > sanlock_var_run_t. Not sure what label vdsm runs with virtd_t? I don't think leases should be labeled as sanlock_var_run_t but they should their own specific type: sanlock_lease_t. I attached a patch for the selinux refpolicy. That said, on the VDSM side we have two options, either we start labeling files in the storage domains (where possible) or we don't use sanlock on local storage domains. Is there a security difference? Ie should we allow/prevent domains from reading sanlock_var_run_t differently then sanlock_lease_t? Do you have file context for sanlock_lease_t? (In reply to comment #8) > Is there a security difference? Ie should we allow/prevent domains from > reading sanlock_var_run_t differently then sanlock_lease_t? Technically at the moment there's not much difference (but for example sanlock_lease_t has nothing to do with files_pid_filetrans). The lases are first-class citizens in sanlock and they deserve their own type. I'm working on restricting the access a little bit more (we can probably grant only read/write on sanlock_lease_t to sanlock_t). > Do you have file context for sanlock_lease_t? No, not yet, sanlock doesn't impose where the leases are created by the applications (which are also responsible to correctly set the context at the moment). I74070ebb: misc: rename safelease to clusterlock [1] I78072254: domain: select the cluster lock using makeClusterLock [2] I106618a9: clusterlock: add the local locking implementation [3] [1] http://gerrit.ovirt.org/#/c/10067/ [2] http://gerrit.ovirt.org/#/c/10281/ [3] http://gerrit.ovirt.org/#/c/10282/ vdsm-4.10.3-6.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/FEDORA-2013-1775/vdsm-4.10.3-6.fc18 vdsm-4.10.3-7.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/vdsm-4.10.3-7.fc18 Package vdsm-4.10.3-7.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing vdsm-4.10.3-7.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-2581/vdsm-4.10.3-7.fc18 then log in and leave karma (feedback). vdsm-4.10.3-7.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report. |