Bug 1329875 - selinux interferes with starting firewalld
Summary: selinux interferes with starting firewalld
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: firewalld
Version: 23
Hardware: x86_64
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Thomas Woerner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-24 06:41 UTC by Thomas Higgins
Modified: 2016-11-23 13:28 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-23 13:28:16 UTC
Type: Bug


Attachments (Terms of Use)
conversation on irc with solution (4.37 KB, text/plain)
2016-04-24 06:41 UTC, Thomas Higgins
no flags Details

Description Thomas Higgins 2016-04-24 06:41:07 UTC
Created attachment 1150091 [details]
conversation on irc with solution

Description of problem: I have installed firewalld on the fedora 23 image that Digital Ocean provides. While I can install firewalld, I cannot start it.

How reproducible: Every time

Steps to Reproduce:
1. after initial fedora install, run dnf install firewalld firewall-config
2. systemctl enable firewalld
3. systemctl start firewalld

Actual results:

When you run systemctl start firewalld, you get:
Job for firewalld.service failed because the control process exited with error code. See "systemctl status firewalld.service" and "journalctl -xe" for details.

In journalctl, you see:
Apr 24 06:35:00 fourth audit[10684]: AVC avc:  denied  { create } for  pid=10684 comm="firewalld" name="firewalld" scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=dir permissive=0
Apr 24 06:35:00 fourth /firewalld[10684]: FATAL ERROR: Fork #1 failed: 13 (Permission denied)
Apr 24 06:35:00 fourth /firewalld[10684]: ERROR: Traceback (most recent call last):
                                            File "/usr/sbin/firewalld", line 128, in startup
                                              os.mkdir(config.FIREWALLD_TEMPDIR, 0o750)
                                          PermissionError: [Errno 13] Permission denied: '/run/firewalld'
Apr 24 06:35:00 fourth systemd[1]: firewalld.service: Main process exited, code=exited, status=1/FAILURE
Apr 24 06:35:00 fourth systemd[1]: Failed to start firewalld - dynamic firewall daemon.

If you dig into the selinux logs you get:
avc:  denied  { create } for  pid=849 comm="firewalld" name="firewalld" scontext=system_u:system_r:firewalld_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=dir permissive=0

Expected results: That firewalld would start

Additional info: I have attached a conversation I had with a person on the fedora IRC, their instructions did get firewalld working in the end, but he recommended submitting a fedora bug.

Also I have opened a bug at digitalocean but they have also told me to submit a fedora bug.

Comment 1 Thomas Woerner 2016-04-27 13:14:53 UTC
Which firewalld version are you using?

Comment 2 Thomas Higgins 2016-04-27 19:54:26 UTC
I am not particularly experienced with Linux, how do I find out what version of firewalld I have installed?

When I install it via dnf, it seems to be grabbing 0.4.0. I haven't changed the default dnf repo on my installation.

Comment 3 Thomas Woerner 2016-04-28 10:06:13 UTC
To get the firewalld package version use:

rpm -q firewalld

Comment 4 Thomas Higgins 2016-04-28 17:54:01 UTC
Thanks Thomas, it is what dnf was grabbing:

firewalld-0.4.0-2.fc23.noarch

Comment 5 Thomas Woerner 2016-06-01 11:31:22 UTC
Which selinux-policy version is installed?

Comment 6 Thomas Higgins 2016-06-09 18:09:41 UTC
I ran sestatus and it gave me Max kernel policy version: 29. Is that the version number you are after?

Comment 7 Thomas Woerner 2016-06-10 11:55:15 UTC
Please add the output of
rpm -q selinux-policy

Comment 8 Thomas Higgins 2016-06-10 16:54:53 UTC
This is the output

selinux-policy-3.13.1-152.fc23.noarch

Comment 9 Thomas Woerner 2016-06-13 12:03:12 UTC
What is the output of

   ls -Z /usr/sbin/firewalld

It should be:

    system_u:object_r:firewalld_exec_t:s0 /usr/sbin/firewalld

If the context is not correct , you can use

   restorecon -rvF $(rpm -qla "*firewall*")

to reset the contexts of all firewall specific files.

Comment 10 Thomas Higgins 2016-07-04 20:28:11 UTC
ls -Z /usr/sbin/firewalld outputs:
system_u:object_r:firewalld_exec_t:s0 /usr/sbin/firewalld

I did run restorecon -rvF $(rpm -qla "*firewall*"), and it made no difference

Comment 11 Thomas Woerner 2016-07-15 15:55:00 UTC
There has been an selinux-policy update that addresses this. Please verify if this is working for you.

Comment 12 Thomas Higgins 2016-08-04 08:46:33 UTC
Thanks Thomas, my apologies for not getting back to this sooner, but this has resolved the issue thanks.

Comment 13 Thomas Woerner 2016-11-23 13:28:16 UTC
Closing due to comment 12.


Note You need to log in before you can comment on or make changes to this bug.