Bug 975702

Summary: SELinux is preventing /usr/lib/systemd/systemd-logind from write access on the directory cpu,cpuacct.
Product: [Fedora] Fedora Reporter: Frank Murphy <frankly3d>
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, systemd-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.11.1-98.fc18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-25 00:40:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Frank Murphy 2013-06-19 07:31:15 UTC
Description of problem:

found 1 alerts in /var/log/audit/audit.log
--------------------------------------------------------------------------------

SELinux is preventing /usr/lib/systemd/systemd-logind from write access on the directory cpu,cpuacct.

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

If you believe that systemd-logind should be allowed write access on the cpu,cpuacct 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 systemd-logind /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp


Additional Information:
Source Context                system_u:system_r:systemd_logind_t:s0
Target Context                system_u:object_r:tmpfs_t:s0
Target Objects                cpu,cpuacct [ dir ]
Source                        systemd-logind
Source Path                   /usr/lib/systemd/systemd-logind
Port                          <Unknown>
Host                          <Unknown>
Source RPM Packages           systemd-201-2.fc18.7.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     frank01.frankly3d.home
Platform                      Linux frank01.frankly3d.home 3.9.6-200.fc18.x86_64
                              #1 SMP Thu Jun 13 18:56:55 UTC 2013 x86_64 x86_64
Alert Count                   17
First Seen                    2013-06-17 19:05:01 IST
Last Seen                     2013-06-18 03:00:01 IST
Local ID                      b3405d46-5e47-4291-8a21-172c8f79be18

Raw Audit Messages
type=AVC msg=audit(1371520801.775:5026): avc:  denied  { write } for  pid=1214 comm="systemd-logind" name="cpu,cpuacct" dev="tmpfs" ino=6646 scontext=system_u:system_r:systemd_logind_t:s0 tcontext=system_u:object_r:tmpfs_t:s0 tclass=dir


type=SYSCALL msg=audit(1371520801.775:5026): arch=x86_64 syscall=open success=no exit=EACCES a0=7fce2fbd67a0 a1=80241 a2=1b6 a3=238 items=0 ppid=1 pid=1214 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=systemd-logind exe=/usr/lib/systemd/systemd-logind subj=system_u:system_r:systemd_logind_t:s0 key=(null)

Hash: systemd-logind,systemd_logind_t,tmpfs_t,dir,write

audit2allow

#============= systemd_logind_t ==============
allow systemd_logind_t tmpfs_t:dir write;

audit2allow -R
require {
	type systemd_logind_t;
}

#============= systemd_logind_t ==============
fs_manage_tmpfs_dirs(systemd_logind_t)

Comment 1 Daniel Walsh 2013-06-19 20:26:33 UTC
Any idea where this is happening?  Looks like some kind of cgroup configuration?

Comment 2 Frank Murphy 2013-06-21 07:34:18 UTC
I have no idea, where it comes from. Guessing it was some systemd crossed wire.

Comment 3 Daniel Walsh 2013-06-21 13:16:04 UTC
Changed default labels for /sys/fs/cgroup to cgroup_t for now

da0155bfdc61b578f3b999037a9686ed2f212a96 in git.

Comment 4 Miroslav Grepl 2013-06-24 10:17:44 UTC
Back ported.

Comment 5 Fedora Update System 2013-06-27 13:36:42 UTC
selinux-policy-3.11.1-98.fc18 has been submitted as an update for Fedora 18.
https://admin.fedoraproject.org/updates/selinux-policy-3.11.1-98.fc18

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

Comment 7 Fedora Update System 2013-07-25 00:40:44 UTC
selinux-policy-3.11.1-98.fc18 has been pushed to the Fedora 18 stable repository.  If problems still persist, please make note of it in this bug report.