Bug 817973

Summary: SELinux is preventing sh from 'getattr' accesses on the file /usr/sbin/setfiles. This alert appears everytime when changing firewalld's default zone in gnome-terminal, with command firewall-cmd --set-default-zone=[zone].
Product: [Fedora] Fedora Reporter: Eduardo Silva <hoboprimate>
Component: firewalldAssignee: Thomas Woerner <twoerner>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, jpopelka, mgrepl, twaugh, twoerner
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard: abrt_hash:6817d478c37a2bbb1faaa09b06705cc42096df6c447364021c98400ea7930151
Fixed In Version: selinux-policy-3.10.0-121.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-05-08 04:22:39 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:
Attachments:
Description Flags
AVC's after running commands in Comment #1 none

Description Eduardo Silva 2012-05-01 23:41:37 UTC
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.3.4-1.fc17.i686
time:           Qua 02 Mai 2012 00:40:10 WEST

description:
:SELinux is preventing sh from 'getattr' accesses on the file /usr/sbin/setfiles.
:
:
:*****  Plugin catchall (100. confidence) suggests  ***************************
:
:If you believe that sh should be allowed getattr access on the setfiles 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 sh /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:
:Additional Information:
:Source Context                system_u:system_r:firewalld_t:s0
:Target Context                system_u:object_r:setfiles_exec_t:s0
:Target Objects                /usr/sbin/setfiles [ file ]
:Source                        sh
:Source Path                   sh
:Port                          <Desconhecida>
:Host                          (removed)
:Source RPM Packages           
:Target RPM Packages           policycoreutils-2.1.11-6.fc17.i686
:Policy RPM                    selinux-policy-3.10.0-118.fc17.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.3.4-1.fc17.i686 #1 SMP Fri
:                              Apr 27 19:40:35 UTC 2012 i686 i686
:Alert Count                   15
:First Seen                    Ter 01 Mai 2012 21:45:52 WEST
:Last Seen                     Qua 02 Mai 2012 00:37:47 WEST
:Local ID                      350886a9-2e8c-4157-9b83-01b03db2a188
:
:Raw Audit Messages
:type=AVC msg=audit(1335915467.726:846): avc:  denied  { getattr } for  pid=5304 comm="sh" path="/usr/sbin/setfiles" dev="dm-1" ino=2110286 scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:object_r:setfiles_exec_t:s0 tclass=file
:
:
:Hash: sh,firewalld_t,setfiles_exec_t,file,getattr
:
:audit2allowunable to open /sys/fs/selinux/policy:  Permission denied
:
:
:audit2allow -Runable to open /sys/fs/selinux/policy:  Permission denied
:
:

Comment 1 Daniel Walsh 2012-05-02 18:00:36 UTC
Looks like firewalld is running setfiles/restorecon to fix the context on an object.

Can you run it in permissive mode and gather all of the AVC's.

# semanage permissive -a firewalld_t
# firewall-cmd --set-default-zone=[zone]
# semanage permissive -d firewalld_t
# ausearch -m avc -ts recent

Comment 2 Eduardo Silva 2012-05-02 18:33:09 UTC
Created attachment 581687 [details]
AVC's after running commands in Comment #1

AVC's after running those commands.

Comment 3 Daniel Walsh 2012-05-02 20:10:08 UTC
Fixed in selinux-policy-3.10.0-120.fc17

Comment 4 Fedora Update System 2012-05-04 19:53:08 UTC
selinux-policy-3.10.0-121.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/selinux-policy-3.10.0-121.fc17

Comment 5 Fedora Update System 2012-05-04 22:16:54 UTC
Package selinux-policy-3.10.0-121.fc17:
* should fix your issue,
* was pushed to the Fedora 17 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.10.0-121.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-7313/selinux-policy-3.10.0-121.fc17
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2012-05-08 04:22:39 UTC
selinux-policy-3.10.0-121.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Tim Waugh 2012-10-24 09:03:49 UTC
I'm seeing this on F18 with selinux-policy-3.11.1-36.fc18.noarch.

Comment 8 Daniel Walsh 2012-10-24 14:50:50 UTC
I thought they were going to remove this from firewalld in F18.

Comment 9 Thomas Woerner 2012-10-24 17:21:29 UTC
There are no setfiles or restorecon calls anymore in firewalld-0.2.9-1 or newer.