RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2227837 - SELinux prevents the pdns service from running when master=yes is configured
Summary: SELinux prevents the pdns service from running when master=yes is configured
Keywords:
Status: CLOSED DUPLICATE of bug 2047945
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: selinux-policy
Version: 9.2
Hardware: x86_64
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Nikola Knazekova
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-07-31 15:55 UTC by lejeczek
Modified: 2024-01-28 04:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-08-17 14:07:41 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-165020 0 None None None 2023-08-09 10:59:13 UTC

Description lejeczek 2023-07-31 15:55:40 UTC
Description of problem:

Hi.

Say one has this:

launch=gmysql
gmysql-host=localhost
gmysql-dbname=powerdns
gmysql-user=powerdns_user
gmysql-password=twooczek9897#dns
gmysql-dnssec=yes

Such 'pdns' will start & run a ok, but if I add this:

master=yes

than:
...
Primary/secondary communicator launching
Creating backend connection for TCP
Exiting because communicator thread died with error: Resolver binding to local UDP socket on '0.0.0.0': Permission denied
About to create 3 backend threads for UDP


'pdns' start is slightly delayed, eventually starts but that denial floods journal log
nis_enabled=1 seems to help, seems to silence "..Permisson denied" - but I wonder if there is or could be a better "fix" for this issue.

many thanks, L.

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

pdns-4.8.1-1.el9.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Nikola Knazekova 2023-08-09 11:28:30 UTC
Hi, 
please reproduce the issue in permissive mode with full auditing enabled and attach SELinux denials:

Permissive mode:
# setenforce 0

Full audit:
1) Open the /etc/audit/rules.d/audit.rules file in an editor.
2) Remove the following line if it exists:
-a task,never
3) Add the following line to the end of the file:
-w /etc/shadow -p w
4) Restart the audit daemon:
  # service auditd restart
5) Re-run your scenario.
6) Collect AVC denials:
  # ausearch -i -m avc,user_avc,selinux_err,user_selinux_err -ts today

Comment 3 Milos Malik 2023-08-10 08:35:35 UTC
A lot of SELinux denials appear in enforcing mode:
----
type=PROCTITLE msg=audit(08/10/2023 04:29:12.542:5938) : proctitle=/usr/sbin/pdns_server --guardian=no --daemon=no --disable-syslog --log-timestamp=no --write-pid=no 
type=SOCKADDR msg=audit(08/10/2023 04:29:12.542:5938) : saddr={ saddr_fam=inet laddr=0.0.0.0 lport=17055 } 
type=SYSCALL msg=audit(08/10/2023 04:29:12.542:5938) : arch=x86_64 syscall=bind success=no exit=EACCES(Permission denied) a0=0x12 a1=0x7f24affa04d0 a2=0x10 a3=0x7f24aff9fa60 items=0 ppid=1 pid=10202 auid=unset uid=pdns gid=pdns euid=pdns suid=pdns fsuid=pdns egid=pdns sgid=pdns fsgid=pdns tty=(none) ses=unset comm=pdns/comm-main exe=/usr/sbin/pdns_server subj=system_u:system_r:pdns_t:s0 key=(null) 
type=AVC msg=audit(08/10/2023 04:29:12.542:5938) : avc:  denied  { name_bind } for  pid=10202 comm=pdns/comm-main src=17055 scontext=system_u:system_r:pdns_t:s0 tcontext=system_u:object_r:unreserved_port_t:s0 tclass=udp_socket permissive=0 
----

Each of them has a different source port (src=...)

# ausearch -m avc -m user_avc -i | audit2allow

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

After enabling the nis_enabled boolean, the pdns service starts and runs successfully.

The following error message does not appear anymore:

pdns_server[...]: Exiting because communicator thread died with error: Resolver binding to local UDP socket on '0.0.0.0': Permission denied

Comment 4 Nikola Knazekova 2023-08-16 08:34:37 UTC
PR: https://github.com/fedora-selinux/selinux-policy/pull/1819

Comment 6 Nikola Knazekova 2023-08-17 14:07:41 UTC

*** This bug has been marked as a duplicate of bug 2047945 ***

Comment 7 Red Hat Bugzilla 2024-01-28 04:25:42 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days


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