Bug 836798

Summary: SELinux is preventing /usr/bin/systemd-tmpfiles from 'getattr' accesses on the fifo_file /tmp/icedteaplugin-simon/1774-icedteanp-plugin-to-appletviewer.
Product: [Fedora] Fedora Reporter: melanphos
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:14facfb1a303ec6dfd5394e38c6291bfd1c24dcfee41012a14271b50ffe003cc
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-07-01 21:12:53 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 melanphos 2012-07-01 13:50:58 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.4.3-1.fc17.x86_64
time:           dim. 01 juil. 2012 15:49:50 CEST

description:
:SELinux is preventing /usr/bin/systemd-tmpfiles from 'getattr' accesses on the fifo_file /tmp/icedteaplugin-simon/1774-icedteanp-plugin-to-appletviewer.
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that systemd-tmpfiles should be allowed getattr access on the 1774-icedteanp-plugin-to-appletviewer fifo_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:user_home_t:s0
:Target Objects                /tmp/icedteaplugin-simon/1774-icedteanp-plugin-to-
:                              appletviewer [ fifo_file ]
:Source                        systemd-tmpfile
:Source Path                   /usr/bin/systemd-tmpfiles
:Port                          <Inconnu>
:Host                          (removed)
:Source RPM Packages           systemd-44-14.fc17.x86_64
:Target RPM Packages           
:Policy RPM                    selinux-policy-3.10.0-132.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.3-1.fc17.x86_64 #1 SMP Mon Jun
:                              18 19:53:17 UTC 2012 x86_64 x86_64
:Alert Count                   14
:First Seen                    dim. 01 juil. 2012 00:04:52 CEST
:Last Seen                     dim. 01 juil. 2012 15:40:44 CEST
:Local ID                      44119808-880d-4f5b-ab8c-408b822d9d60
:
:Raw Audit Messages
:type=AVC msg=audit(1341150044.956:153): avc:  denied  { getattr } for  pid=1862 comm="systemd-tmpfile" path="/tmp/icedteaplugin-simon/1774-icedteanp-plugin-to-appletviewer" dev="sda2" ino=660531 scontext=system_u:system_r:systemd_tmpfiles_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=fifo_file
:
:
:type=SYSCALL msg=audit(1341150044.956:153): arch=x86_64 syscall=newfstatat success=no exit=EACCES a0=5 a1=16bd00b a2=7fff291c6fe0 a3=100 items=0 ppid=1 pid=1862 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=/usr/bin/systemd-tmpfiles subj=system_u:system_r:systemd_tmpfiles_t:s0 key=(null)
:
:Hash: systemd-tmpfile,systemd_tmpfiles_t,user_home_t,fifo_file,getattr
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Miroslav Grepl 2012-07-01 21:12:53 UTC
Do you know what you were doing when this happened? 

The problem is "1774-icedteanp-plugin-to-appletviewer" is labeled as user_home_t in the /tmp directory.

Execute

# chcon -t user_tmp_t /tmp/icedteaplugin-simon/1774-icedteanp-plugin-to-appletviewe


to fix this issue.

Comment 2 melanphos 2012-07-01 21:27:00 UTC
Hi, its a recurent issue to me. Since fedora 16 (or maybe 15). SElinux alert about a lot of acces of systemd-tmpfile and tmpwatch in the /tmp repertory, principaly on *-icedteanp-plugin-to-appletviewer and pulse-*

I did several restorecon -R /tmp, but still the same problem.

Comment 3 Daniel Walsh 2012-07-02 11:39:45 UTC
Could you clean the contents of this directory and see if it happens again.

rm -rf /tmp/* /tmp/.?*

restorecon on /tmp does nothing, since SELinux has no way of knowing the contents of /tmp.  I bet you have old files there that have been mislabeled for a long time.

In F18 we are moving to a tmpfs /tmp which would clean out /tmp on a reboot.