Bug 1278983

Summary: SELinux is preventing SetroubleshootF from 'write' accesses on the directory /var/tmp.
Product: [Fedora] Fedora Reporter: Paul Finnigan <paul>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: high    
Version: 23CC: cutnioff, dimitri.papadopoulos, doctorrrrrrr, dominick.grift, dwalsh, fedora, lovenemesis, lvrabec, mgrepl, Michiduta07, plautrba, thomas.mey, tom.ghyselinck
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:a61bd1e7b3cddab59321dc0f41ab4e0fa7420de2ef71e32f5a3da54f92f199d5;VARIANT_ID=workstation;
Fixed In Version: selinux-policy-3.13.1-158.6.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1279396 (view as bug list) Environment:
Last Closed: 2016-02-17 03:50:46 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:    
Bug Blocks: 1279396    
Attachments:
Description Flags
proposed patch none

Description Paul Finnigan 2015-11-06 22:47:51 UTC
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 Madd Sauer 2016-01-12 20:41:30 UTC
Description of problem:
#1 installed abcde
#2 started abcde as user (non-root)
#3 this message poped up.

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

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

Comment 2 cutnioff 2016-01-13 06:22:58 UTC
$ sudo rpm -qa | grep -i abcde
$

Comment 3 Petr Lautrbach 2016-02-11 00:02:42 UTC
Until there's refactored code in sealert it would need to use similar fix as 14ce26603c60b9cf8fb98b0be0f2209cedf7bc45 to allow setroubleshoot_fixit_t to create and manage temp files.

Comment 4 Petr Lautrbach 2016-02-11 00:05:16 UTC
Created attachment 1123024 [details]
proposed patch

I've not tested this patch yet but it should work. Still I will try to refactor the sealert code.

Comment 6 Fedora Update System 2016-02-11 14:27:58 UTC
selinux-policy-3.13.1-158.6.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-36a160982c

Comment 7 Fedora Update System 2016-02-14 16:23:40 UTC
selinux-policy-3.13.1-158.6.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-36a160982c

Comment 8 Fedora Update System 2016-02-17 03:50:16 UTC
selinux-policy-3.13.1-158.6.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.