Bug 684420

Summary: SELinux is preventing /bin/systemd-tmpfiles from 'getattr' accesses on the blk_file /tmp/initrd.yvQczh/dev/ram1.
Product: [Fedora] Fedora Reporter: Jeff Layton <jlayton>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 15CC: dwalsh, mgrepl, steved
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: setroubleshoot_trace_hash:eaf6e0cdcc78446c1c4aeb3acd3998d5d6fdedc0d00a54d1a379ce1aadf9a390
Fixed In Version: selinux-policy-3.9.16-5.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-03-19 05:54:04 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 Jeff Layton 2011-03-12 12:39:03 UTC
SELinux is preventing /bin/systemd-tmpfiles from 'getattr' accesses on the blk_file /tmp/initrd.yvQczh/dev/ram1.

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

If you believe that systemd-tmpfiles should be allowed getattr access on the ram1 blk_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 systemd-tmpfile /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:systemd_tmpfiles_t:s0
Target Context                unconfined_u:object_r:initrc_tmp_t:s0
Target Objects                /tmp/initrd.yvQczh/dev/ram1 [ blk_file ]
Source                        systemd-tmpfile
Source Path                   /bin/systemd-tmpfiles
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-units-20-1.fc15
Target RPM Packages           
Policy RPM                    selinux-policy-3.9.16-1.fc15
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed)
                              2.6.38-0.rc8.git0.1.fc15.x86_64 #1 SMP Tue Mar 8
                              08:22:15 UTC 2011 x86_64 x86_64
Alert Count                   2
First Seen                    Thu 10 Mar 2011 10:52:27 AM EST
Last Seen                     Sat 12 Mar 2011 07:37:33 AM EST
Local ID                      1ac4e5d3-25ae-4817-ab09-563445f5add2

Raw Audit Messages
type=AVC msg=audit(1299933453.589:89): avc:  denied  { getattr } for  pid=3198 comm="systemd-tmpfile" path="/tmp/initrd.yvQczh/dev/ram1" dev=sda3 ino=4720542 scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=unconfined_u:object_r:initrc_tmp_t:s0 tclass=blk_file


type=SYSCALL msg=audit(1299933453.589:89): arch=x86_64 syscall=newfstatat success=yes exit=0 a0=7 a1=18fd583 a2=7fffe27c3ab0 a3=100 items=0 ppid=1 pid=3198 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=systemd-tmpfile exe=/bin/systemd-tmpfiles subj=system_u:system_r:systemd_tmpfiles_t:s0 key=(null)

Hash: systemd-tmpfile,systemd_tmpfiles_t,initrc_tmp_t,blk_file,getattr

audit2allow

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t initrc_tmp_t:blk_file getattr;

audit2allow -R

#============= systemd_tmpfiles_t ==============
allow systemd_tmpfiles_t initrc_tmp_t:blk_file getattr;

Comment 1 Miroslav Grepl 2011-03-14 09:19:44 UTC
Well, this is a problem with systemd-tmpfile and /tmp directory and making things like this. We already have

files_getattr_all_dirs(systemd_tmpfiles_t)
files_getattr_all_files(systemd_tmpfiles_t)

and I think we will need to allow it.

Comment 2 Daniel Walsh 2011-03-14 18:58:35 UTC
Added

	delete_chr_files_pattern($1, tmpfile, tmpfile)
	delete_blk_files_pattern($1, tmpfile, tmpfile)

To files_purge_tmp

Fixed in selinux-policy-3.9.16-4.fc15

Comment 3 Fedora Update System 2011-03-17 15:28:56 UTC
selinux-policy-3.9.16-5.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/selinux-policy-3.9.16-5.fc15

Comment 4 Fedora Update System 2011-03-19 05:53:08 UTC
selinux-policy-3.9.16-5.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.