Bug 1473119

Summary: SELinux is preventing firewalld from 'relabelfrom' accesses on the file /etc/sysconfig/network-scripts/ifcfg-enp2s0.bak.
Product: [Fedora] Fedora Reporter: Mikhail <mikhail.v.gavrilov>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 27CC: dominick.grift, dwalsh, lsm5, lvrabec, mgrepl, plautrba, rabin, ssekidde
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:e788fba9404677f2badd5d9d4caff7138c406df2da2f36acb291c0a8a5c65069;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-30 22:36:08 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 Mikhail 2017-07-20 04:49:55 UTC
Description of problem:
SELinux is preventing firewalld from 'relabelfrom' accesses on the file /etc/sysconfig/network-scripts/ifcfg-enp2s0.bak.

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

If you believe that firewalld should be allowed relabelfrom access on the ifcfg-enp2s0.bak 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:
# ausearch -c 'firewalld' --raw | audit2allow -M my-firewalld
# semodule -X 300 -i my-firewalld.pp

Additional Information:
Source Context                system_u:system_r:firewalld_t:s0
Target Context                unconfined_u:object_r:net_conf_t:s0
Target Objects                /etc/sysconfig/network-scripts/ifcfg-enp2s0.bak [
                              file ]
Source                        firewalld
Source Path                   firewalld
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-264.fc27.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.13.0-0.rc1.git0.1.fc27.x86_64 #1
                              SMP Mon Jul 17 16:03:16 UTC 2017 x86_64 x86_64
Alert Count                   2
First Seen                    2017-07-19 14:08:56 +05
Last Seen                     2017-07-19 14:13:00 +05
Local ID                      7215517a-deb4-4be9-a923-60e14c4ed455

Raw Audit Messages
type=AVC msg=audit(1500455580.528:316): avc:  denied  { relabelfrom } for  pid=752 comm="firewalld" name="ifcfg-enp2s0.bak" dev="sda1" ino=2885753 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:net_conf_t:s0 tclass=file permissive=0


Hash: firewalld,firewalld_t,net_conf_t,file,relabelfrom

Version-Release number of selected component:
selinux-policy-3.13.1-264.fc27.noarch

Additional info:
component:      selinux-policy
reporter:       libreport-2.9.1
hashmarkername: setroubleshoot
kernel:         4.13.0-0.rc1.git1.1.fc27.x86_64
type:           libreport

Potential duplicate: bug 1365178

Comment 1 Rabin 2017-07-31 12:04:02 UTC
This is long time bug - just Google for "SELinux is preventing firewalld from relabelfrom access on the file" , and it's look like no one from RH/Fedora team will try and fix this.

even when trying to switch to premissive mode to log the event and create a new policy I get this, 

---- ✄ -----------------------

# ausearch -c 'firewalld' --raw | audit2allow


#============= firewalld_t ==============

#!!!! This avc is a constraint violation.  You would need to modify the attributes of either the source or target types to allow this access.
#Constraint rule:
#       constrain file { create relabelfrom relabelto } ((u1 == u2 -Fail-)  or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED

#       Possible cause is the source user (system_u) and target user (unconfined_u) are different.
allow firewalld_t firewalld_etc_rw_t:file { relabelfrom relabelto };

---- ✄ -----------------------

Comment 2 Jan Kurik 2017-08-15 08:47:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 3 Ben Cotton 2018-11-27 14:35:51 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2018-11-30 22:36:08 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.