Bug 1311299 - Cannot start nsd with selinux enabled
Summary: Cannot start nsd with selinux enabled
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 23
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: Lukas Vrabec
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-23 20:49 UTC by Ed Marshall
Modified: 2016-12-20 18:58 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-20 18:58:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ed Marshall 2016-02-23 20:49:25 UTC
"Description of problem:
Cannot start nsd on a fresh install with selinux enabled. To get this far, you have to work around bug #1311294 by running "/usr/sbin/nsd-control-setup -d /etc/nsd/" as root, chowning the resulting files to root:nsd, and running restorecon on the directory (like the nsd-keygen.service unit file tries but fails to do).

Version-Release number of selected component (if applicable):
4.1.7-4

How reproducible:
Every time

Steps to Reproduce:
1. dnf install nsd
2. /usr/sbin/nsd-control-setup -d /etc/nsd/
3. chown root:nsd /etc/nsd/nsd_*
4. restorecon /etc/nsd/*
5. systemctl start nsd.service
6. no output, but fails to start

Actual results:

journalctl says:

Feb 23 20:41:15 hostname systemd[1]: Started NSD Control Key And Certificate Generator.
Feb 23 20:41:15 hostname systemd[1]: Started NSD DNS Server.
Feb 23 20:41:15 hostname audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nsd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Feb 23 20:41:15 hostname systemd[1]: Starting NSD DNS Server...
Feb 23 20:41:15 hostname audit[8364]: AVC avc:  denied  { name_bind } for  pid=8364 comm="nsd" src=8952 scontext=system_u:system_r:nsd_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=tcp_socket permissive=0
Feb 23 20:41:15 hostname nsd[8364]: can't bind tcp socket: Permission denied
Feb 23 20:41:15 hostname nsd[8364]: [2016-02-23 20:41:15.608] nsd[8364]: error: can't bind tcp socket: Permission denied
Feb 23 20:41:15 hostname nsd[8364]: cannot open control interface ::1 8952
Feb 23 20:41:15 hostname nsd[8364]: [2016-02-23 20:41:15.609] nsd[8364]: error: cannot open control interface ::1 8952
Feb 23 20:41:15 hostname nsd[8364]: could not open remote control port
Feb 23 20:41:15 hostname nsd[8364]: [2016-02-23 20:41:15.610] nsd[8364]: error: could not open remote control port
Feb 23 20:41:15 hostname nsd[8364]: could not perform remote control setup
Feb 23 20:41:15 hostname nsd[8364]: [2016-02-23 20:41:15.611] nsd[8364]: error: could not perform remote control setup
Feb 23 20:41:15 hostname systemd[1]: nsd.service: Main process exited, code=exited, status=1/FAILURE
Feb 23 20:41:15 hostname systemd[1]: nsd.service: Unit entered failed state.
Feb 23 20:41:15 hostname audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=nsd comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Feb 23 20:41:15 hostname systemd[1]: nsd.service: Failed with result 'exit-code'.

Expected results:
nsd starts with the control interface up and running.

Additional info:
If you disable the control interface entirely, you get a running (and working) nsd at the end of it, but that's obviously not ideal.

Both this and bug #1303760 smell like something has happened with the nsd selinux policies recently.

Comment 1 Ed Marshall 2016-02-23 20:54:27 UTC
Bug #1303760 *might* be the same issue.

Comment 2 d. johnson 2016-02-24 01:36:07 UTC
According to the troubleshooter:

#!!!! This avc can be allowed using the boolean 'nis_enabled'
allow nsd_t unreserved_port_t:tcp_socket name_bind;

Changing the boolean nis_enabled is not ideal, but would likely allow this to work.

(Installing a package should not change the boolean for the user however.)

Comment 3 Fedora End Of Life 2016-11-24 15:44:05 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. 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 '23'.

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 23 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 Fedora End Of Life 2016-12-20 18:58:56 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 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.


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