Bug 918121

Summary: SELinux is preventing /usr/bin/qemu-kvm from using the 'setrlimit' accesses on a process.
Product: [Fedora] Fedora Reporter: Sebastian Trebitz <sebastian>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:0df4d8bdcc47b373dee2816ae085077a21236baaa7cdd677fa2b460cb7e188bd
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-14 03:03:49 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 Sebastian Trebitz 2013-03-05 14:19:03 UTC
Description of problem:
SELinux is preventing /usr/bin/qemu-kvm from using the 'setrlimit' accesses on a process.

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

If you believe that qemu-kvm should be allowed setrlimit access on processes labeled svirt_t 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 qemu-kvm /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:svirt_t:s0:c339,c967
Target Context                system_u:system_r:svirt_t:s0:c339,c967
Target Objects                 [ process ]
Source                        qemu-kvm
Source Path                   /usr/bin/qemu-kvm
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           qemu-system-x86-1.2.2-6.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-82.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.8.1-201.fc18.x86_64 #1 SMP Thu
                              Feb 28 19:23:08 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-03-05 15:16:18 CET
Last Seen                     2013-03-05 15:16:18 CET
Local ID                      6372033e-d5a5-446f-a1ae-5fed215c779c

Raw Audit Messages
type=AVC msg=audit(1362492978.364:376): avc:  denied  { setrlimit } for  pid=17455 comm="qemu-kvm" scontext=system_u:system_r:svirt_t:s0:c339,c967 tcontext=system_u:system_r:svirt_t:s0:c339,c967 tclass=process


type=SYSCALL msg=audit(1362492978.364:376): arch=x86_64 syscall=setrlimit success=no exit=EACCES a0=4 a1=7fff82e811c0 a2=7f81a6df8ac0 a3=7f81ac418cd0 items=0 ppid=17453 pid=17455 auid=4294967295 uid=107 gid=107 euid=107 suid=107 fsuid=107 egid=107 sgid=107 fsgid=107 ses=4294967295 tty=(none) comm=qemu-kvm exe=/usr/bin/qemu-kvm subj=system_u:system_r:svirt_t:s0:c339,c967 key=(null)

Hash: qemu-kvm,svirt_t,svirt_t,process,setrlimit

audit2allow

#============= svirt_t ==============
allow svirt_t self:process setrlimit;

audit2allow -R

#============= svirt_t ==============
allow svirt_t self:process setrlimit;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.8.1-201.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-03-05 16:18:24 UTC
78d84643dc034b370c9b6b4bc8da896d24951d9c allows this in Rawhide.

Comment 2 Miroslav Grepl 2013-03-06 09:42:37 UTC
Backported.

commit 9eef5156d2d64fcc4423da3e3d069cc98de077fd
Author: Dan Walsh <dwalsh>
Date:   Tue Mar 5 11:16:59 2013 -0500

    Allow virtual machines to setrlimit and send itself signals.

Comment 3 Fedora Update System 2013-03-08 16:12:34 UTC
selinux-policy-3.11.1-84.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-84.fc18

Comment 4 Fedora Update System 2013-03-09 00:00:06 UTC
Package selinux-policy-3.11.1-84.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 selinux-policy-3.11.1-84.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3605/selinux-policy-3.11.1-84.fc18
then log in and leave karma (feedback).

Comment 5 Fedora Update System 2013-03-12 23:39:15 UTC
Package selinux-policy-3.11.1-85.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 selinux-policy-3.11.1-85.fc18'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-3605/selinux-policy-3.11.1-85.fc18
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2013-03-14 03:03:51 UTC
selinux-policy-3.11.1-85.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.