Bug 1279396

Summary: SELinux is preventing SetroubleshootF from 'write' accesses on the directory /var/tmp.
Product: [Fedora] Fedora Reporter: Miroslav Grepl <mgrepl>
Component: setroubleshootAssignee: Petr Lautrbach <plautrba>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: dominick.grift, dwalsh, extras-qa, lvrabec, mgrepl, plautrba
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:a61bd1e7b3cddab59321dc0f41ab4e0fa7420de2ef71e32f5a3da54f92f199d5;VARIANT_ID=workstation;
Fixed In Version: setroubleshoot-3.3.4-1.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1278983 Environment:
Last Closed: 2016-02-21 16:26:35 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:
Bug Depends On: 1278983    
Bug Blocks:    

Description Miroslav Grepl 2015-11-09 11:31:14 UTC
+++ This bug was initially created as a clone of Bug #1278983 +++

Description of problem:
This happened after attempting to run restorecon for a problem with the provided button in SELinux Alert Browser. The 'fixes' were needed after updating my Fedora 22 system to Fedora 23. There were two other related problems. I will mark them as related once I have all the numbers.
SELinux is preventing SetroubleshootF from 'write' accesses on the directory /var/tmp.

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

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

Additional Information:
Source Context                system_u:system_r:setroubleshoot_fixit_t:s0-s0:c0.
                              c1023
Target Context                system_u:object_r:tmp_t:s0
Target Objects                /var/tmp [ dir ]
Source                        SetroubleshootF
Source Path                   SetroubleshootF
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           filesystem-3.2-35.fc23.x86_64
Policy RPM                    selinux-policy-3.13.1-152.fc23.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.2.5-300.fc23.x86_64 #1 SMP Tue
                              Oct 27 04:29:56 UTC 2015 x86_64 x86_64
Alert Count                   6
First Seen                    2015-11-06 22:36:52 GMT
Last Seen                     2015-11-06 22:36:52 GMT
Local ID                      9e1ef59e-fcba-41f2-89bb-e87d6cb33ea6

Raw Audit Messages
type=AVC msg=audit(1446849412.408:817): avc:  denied  { write } for  pid=12161 comm="SetroubleshootF" name="tmp" dev="sda2" ino=130145 scontext=system_u:system_r:setroubleshoot_fixit_t:s0-s0:c0.c1023 tcontext=system_u:object_r:tmp_t:s0 tclass=dir permissive=0


Hash: SetroubleshootF,setroubleshoot_fixit_t,tmp_t,dir,write

Version-Release number of selected component:
selinux-policy-3.13.1-152.fc23.noarch

Additional info:
reporter:       libreport-2.6.3
hashmarkername: setroubleshoot
kernel:         4.2.5-300.fc23.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2015-11-09 11:33:07 UTC
Try to fix labeling  using "Restore Context" button in SEAlert in permissive mode and getting

"Unable to grant access."

Nov 09 12:32:02 localhost.localdomain dbus[833]: [system] Successfully activated service 'org.freedesktop.problems'
Nov 09 12:32:02 localhost.localdomain org.fedoraproject.SetroubleshootFixit[833]: Traceback (most recent call last):
Nov 09 12:32:02 localhost.localdomain org.fedoraproject.SetroubleshootFixit[833]: File "/usr/share/setroubleshoot/SetroubleshootFixit.py", line 6, in <module>
Nov 09 12:32:02 localhost.localdomain org.fedoraproject.SetroubleshootFixit[833]: import gobject
Nov 09 12:32:02 localhost.localdomain org.fedoraproject.SetroubleshootFixit[833]: ImportError: No module named 'gobject'
Nov 09 12:32:02 localhost.localdomain dbus[833]: [system] Activated service 'org.fedoraproject.SetroubleshootFixit' failed: Launch helper exited with unknown return code 1
Nov 09 12:32:02 localhost.localdomain org.fedoraproject.Setroubleshootd[1849]: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

Comment 2 Fedora Update System 2016-02-11 13:23:58 UTC
setroubleshoot-3.3.4-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-7f1bb98792

Comment 3 Fedora Update System 2016-02-14 16:23:49 UTC
setroubleshoot-3.3.4-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-7f1bb98792

Comment 4 Fedora Update System 2016-02-21 16:26:28 UTC
setroubleshoot-3.3.4-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.