Bug 1013909 - SELinux is preventing /usr/sbin/oxenstored from 'search' accesses on the directory /etc/xen.
Summary: SELinux is preventing /usr/sbin/oxenstored from 'search' accesses on the dire...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 19
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:fbbd222541b370d2eb26653ac37...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-01 03:31 UTC by Jeremy Fitzhardinge
Modified: 2015-02-18 11:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-18 11:18:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jeremy Fitzhardinge 2013-10-01 03:31:17 UTC
Description of problem:
When using oxenstored as a substitute for xenstored, it needs access to its config file in /etc/xen/oxenstored.conf.
SELinux is preventing /usr/sbin/oxenstored from 'search' accesses on the directory /etc/xen.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that oxenstored should be allowed search access on the xen directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep oxenstored /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:xenstored_t:s0
Target Context                system_u:object_r:virt_etc_t:s0
Target Objects                /etc/xen [ dir ]
Source                        oxenstored
Source Path                   /usr/sbin/oxenstored
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           xen-ocaml-4.2.3-1.fc19.x86_64
Target RPM Packages           xen-runtime-4.2.3-1.fc19.x86_64
Policy RPM                    selinux-policy-3.12.1-74.4.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.1-200.fc19.x86_64 #1 SMP Sat
                              Sep 14 15:04:51 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-09-30 20:26:07 PDT
Last Seen                     2013-09-30 20:26:07 PDT
Local ID                      d09dc2db-eb61-4b09-b6b7-92711ce85007

Raw Audit Messages
type=AVC msg=audit(1380597967.346:27): avc:  denied  { search } for  pid=712 comm="oxenstored" name="xen" dev="dm-2" ino=270351 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:virt_etc_t:s0 tclass=dir


type=SYSCALL msg=audit(1380597967.346:27): arch=x86_64 syscall=stat success=no exit=EACCES a0=7f9eaf9b5c08 a1=7fffc169c910 a2=7fffc169c910 a3=68dab8 items=0 ppid=1 pid=712 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=oxenstored exe=/usr/sbin/oxenstored subj=system_u:system_r:xenstored_t:s0 key=(null)

Hash: oxenstored,xenstored_t,virt_etc_t,dir,search

Additional info:
reporter:       libreport-2.1.7
hashmarkername: setroubleshoot
kernel:         3.11.1-200.fc19.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2013-10-01 10:54:28 UTC
Hi, 

Could you try to reproduce this in Permissive mode and attach your AVC's? 

You can switch to permissive mode using "# setenforce 0", after that you can switch to enforcing mode again.

Comment 2 Daniel Walsh 2013-10-04 19:50:15 UTC
Looks like it needs read.

Comment 3 Jeremy Fitzhardinge 2013-10-23 17:35:08 UTC
SELinux is preventing /usr/sbin/oxenstored from read access on the file /etc/xen/oxenstored.conf.

*****  Plugin catchall (100. confidence) suggests  ***************************

If you believe that oxenstored should be allowed read access on the oxenstored.conf file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep oxenstored /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


Additional Information:
Source Context                system_u:system_r:xenstored_t:s0
Target Context                system_u:object_r:virt_etc_t:s0
Target Objects                /etc/xen/oxenstored.conf [ file ]
Source                        oxenstored
Source Path                   /usr/sbin/oxenstored
Port                          <Unknown>
Host                          saboo.goop.org
Source RPM Packages           xen-ocaml-4.2.3-4.fc19.x86_64
Target RPM Packages           xen-ocaml-4.2.3-4.fc19.x86_64
Policy RPM                    selinux-policy-3.12.1-74.10.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Permissive
Host Name                     saboo.goop.org
Platform                      Linux saboo.goop.org 3.11.4-201.fc19.x86_64 #1 SMP
                              Thu Oct 10 14:11:18 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-10-23 10:30:07 PDT
Last Seen                     2013-10-23 10:30:07 PDT
Local ID                      8929cf9f-4dd4-4585-8653-3511e875932f

Raw Audit Messages
type=AVC msg=audit(1382549407.760:23): avc:  denied  { read } for  pid=700 comm="oxenstored" name="oxenstored.conf" dev="dm-2" ino=263753 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:virt_etc_t:s0 tclass=file


type=AVC msg=audit(1382549407.760:23): avc:  denied  { open } for  pid=700 comm="oxenstored" path="/etc/xen/oxenstored.conf" dev="dm-2" ino=263753 scontext=system_u:system_r:xenstored_t:s0 tcontext=system_u:object_r:virt_etc_t:s0 tclass=file


type=SYSCALL msg=audit(1382549407.760:23): arch=x86_64 syscall=open success=yes exit=ESRCH a0=120e330 a1=0 a2=0 a3=7fffa4e68180 items=0 ppid=1 pid=700 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=oxenstored exe=/usr/sbin/oxenstored subj=system_u:system_r:xenstored_t:s0 key=(null)

Hash: oxenstored,xenstored_t,virt_etc_t,file,read

Comment 4 Jeremy Fitzhardinge 2013-10-23 17:37:43 UTC
Ah, I had also done:

sudo semanage fcontext -a -f -- -t xenstored_exec_t '(/usr)?/sbin/oxenstored'

so that xenstored and oxenstored have the same type on their executables:

$ ls -lZ /sbin/oxenstored /sbin/xenstored
-rwxr-xr-x. root root system_u:object_r:xenstored_exec_t:s0 /sbin/oxenstored
-rwxr-xr-x. root root system_u:object_r:xenstored_exec_t:s0 /sbin/xenstored

But I don't think this is the case in the default xen-ocaml package (though rpm -V doesn't complain about a mismatch; does it check?).

Comment 5 Daniel Walsh 2013-10-24 18:08:57 UTC
1188fd038c00219bc4592b9fc1276436bae789d8 fixes this in git.

Comment 6 Lukas Vrabec 2013-10-24 18:13:39 UTC
back ported.

Comment 7 Fedora Update System 2013-11-08 09:07:23 UTC
selinux-policy-3.12.1-74.12.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/selinux-policy-3.12.1-74.12.fc19

Comment 8 Fedora Update System 2013-11-09 03:36:02 UTC
Package selinux-policy-3.12.1-74.12.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing selinux-policy-3.12.1-74.12.fc19'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-20980/selinux-policy-3.12.1-74.12.fc19
then log in and leave karma (feedback).

Comment 9 Fedora End Of Life 2015-01-09 22:40:21 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

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.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 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, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

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.

Comment 10 Fedora End Of Life 2015-02-18 11:18:48 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 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. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.