Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1591281

Summary: dnsmasq can not send dbus message to privileged container
Product: Red Hat Enterprise Linux 7 Reporter: Ben Bennett <bbennett>
Component: container-selinuxAssignee: Lokesh Mandvekar <lsm5>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 7.5CC: bbennett, ddarrah, dwalsh, hongli, lsu, lvrabec, mgrepl, mmalik, plautrba, sdodson, ssekidde, wmeng
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: container-selinux-2.66-1.el7_5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-06-26 18:40:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Bennett 2018-06-14 13:11:26 UTC
Description of problem:

When running OpenShift 3.10 the SDN component handles DNS and that has been moved into a privileged pod.  The SDN pod sends dbus messages to tell dnsmasq to change the servers it talks to.  And then it watches for the dnsmasq UP messages to reprogram it when it restarts.

I watched the dbus messages with:
  dbus-monitor --monitor --address unix:path=/var/run/dbus/system_bus_socket
And see that the messages sent by the pod work, but the replies and broadcast UP messages are forbidden by selinux policy.




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

RHEL 7.5


How reproducible:

100%

Steps to Reproduce:
1. Install and run OpenShift 3.10 on a 7.5 machine
2. dig kubernetes.default.svc.cluster.local.
3. systemctl restart dnsmasq
4. dig kubernetes.default.svc.cluster.local.


Actual results:

Step 4 returns no address.


Expected results:

Step 4 returns the same address as step 1.


Additional info:

# ausearch -m USER_AVC
...
type=USER_AVC msg=audit(1528917015.293:21021): pid=578 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { send_msg } for msgtype=signal interface=uk.org.thekelleys.dnsmasq member=Up dest=org.freedesktop.DBus spid=29545 tpid=22466 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:system_r:spc_t:s0 tclass=dbus  exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'
...
type=USER_AVC msg=audit(1528920265.551:22681): pid=578 uid=81 auid=4294967295 ses=4294967295 subj=system_u:system_r:system_dbusd_t:s0-s0:c0.c1023 msg='avc:  denied  { send_msg } for msgtype=method_return dest=:1.523 spid=29545 tpid=25068 scontext=system_u:system_r:dnsmasq_t:s0 tcontext=system_u:system_r:spc_t:s0 tclass=dbus  exe="/usr/bin/dbus-daemon" sauid=81 hostname=? addr=? terminal=?'


I tried:
# audit2allow -R -m local > local.te; make -f /usr/share/selinux/devel/Makefile local.pp; semodule -i local.pp

And the module loaded... but the problem was not solved.

Comment 2 Daniel Walsh 2018-06-14 16:37:13 UTC
Lukas the problem here is the dnsmasq_t is not in a system_debus.

dbus_system_domain(dnsmasq_t, system_r) 

Should be added to upstream policy so that this would be allowed.

Comment 3 Daniel Walsh 2018-06-14 16:45:46 UTC
Fixed in container-selinux-2.66-1.el7_5

Comment 4 Scott Dodson 2018-06-14 16:51:04 UTC
Can this make 7.5.2?

Comment 5 Daniel Walsh 2018-06-14 17:16:17 UTC
I set all of the blocker flags and it is building right now, not sure if we missed the deadline or not.

Comment 8 Ben Bennett 2018-06-15 13:21:20 UTC
We validated the fix and it works perfectly.  Thanks everyone for this last-minute work!

Comment 11 errata-xmlrpc 2018-06-26 18:40:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:2036