Bug 993259

Summary: SELinux is preventing /usr/lib/systemd/systemd from using the 'setrlimit' accesses on a process.
Product: [Fedora] Fedora Reporter: Lloyd Smith <lsmith>
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, igeorgex, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:2a35c41c410ba3b47eaffb49680d0b0ba85f9451d0f1da8bb30d63bd73b6e3f6
Fixed In Version: selinux-policy-3.11.1-103.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-23 00:44:17 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 Lloyd Smith 2013-08-05 17:49:10 UTC
Description of problem:
Starting a new LXC container could not succeed because systemd could not call setrlimit

systemd 201 running in system mode. (+PAM +LIBWRAP +AUDIT +SELINUX +IMA +SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ)
Detected virtualization 'lxc-libvirt'.

Welcome to Fedora 18 (Spherical Cow)!

Set hostname to <localhost.localdomain>.
Initializing machine ID from container UUID.
Setting RLIMIT_NOFILE failed: Permission denied
SELinux is preventing /usr/lib/systemd/systemd from using the 'setrlimit' accesses on a process.

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

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

Additional Information:
Source Context                system_u:system_r:svirt_lxc_net_t:s0:c1,c2
Target Context                system_u:system_r:svirt_lxc_net_t:s0:c1,c2
Target Objects                 [ process ]
Source                        systemd
Source Path                   /usr/lib/systemd/systemd
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           dbus-1.6.12-1.fc18.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-98.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.11-200.fc18.x86_64 #1 SMP Mon
                              Jul 22 21:04:50 UTC 2013 x86_64 x86_64
Alert Count                   7
First Seen                    2013-08-05 13:24:42 EDT
Last Seen                     2013-08-05 13:24:45 EDT
Local ID                      52d56573-9468-4aa4-8b8a-3276bb77412d

Raw Audit Messages
type=AVC msg=audit(1375723485.293:1610): avc:  denied  { setrlimit } for  pid=12758 comm="dbus-daemon" scontext=system_u:system_r:svirt_lxc_net_t:s0:c1,c2 tcontext=system_u:system_r:svirt_lxc_net_t:s0:c1,c2 tclass=process


type=SYSCALL msg=audit(1375723485.293:1610): arch=x86_64 syscall=setrlimit success=no exit=EACCES a0=7 a1=7fff7a990f80 a2=7fff7a991170 a3=2ef39c items=0 ppid=1 pid=12758 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=dbus-daemon exe=/usr/bin/dbus-daemon subj=system_u:system_r:svirt_lxc_net_t:s0:c1,c2 key=(null)

Hash: systemd,svirt_lxc_net_t,svirt_lxc_net_t,process,setrlimit

audit2allow

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

audit2allow -R
require {
	type svirt_lxc_net_t;
	class process setrlimit;
}

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


Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.11-200.fc18.x86_64
type:           libreport

Comment 1 Daniel Walsh 2013-08-05 18:49:23 UTC
Miroslav, we should just back port virt.te to F18.

Comment 2 Miroslav Grepl 2013-08-07 14:48:22 UTC
Yes, you are right.

commit f4f797922a34420c5cb64ef4043c78de47708013
Author: Miroslav Grepl <mgrepl>
Date:   Wed Aug 7 16:48:04 2013 +0200

    Back port virt.te from F19

Comment 3 Fedora Update System 2013-09-02 15:28:22 UTC
selinux-policy-3.11.1-101.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-101.fc18

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

Comment 5 Fedora Update System 2013-09-10 11:17:14 UTC
selinux-policy-3.11.1-103.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-103.fc18

Comment 6 Fedora Update System 2013-09-23 00:44:17 UTC
selinux-policy-3.11.1-103.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.