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.
Description of problem:
RPM scriptlets (rpm_script_t) can execute hostnamectl, but systemd-hostnamed is not able to reply:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# sesearch -A -s rpm_script_t -c dbus -t systemd_hostnamed_t
allow dbusd_unconfined nsswitch_domain:dbus send_msg;
allow dbusd_unconfined systemd_hostnamed_t:dbus send_msg;
# sesearch -A -t rpm_script_t -c dbus -s systemd_hostnamed_t
--> nothing
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Please make sure that every DBus message sender can get replies, it's very likely that such issue applies to other system components.
Version-Release number of selected component (if applicable):
selinux-policy-3.14.3-108.el8.noarch
How reproducible:
Always
Thank you for reporting this issue, I've cloned it for further checking and resolving in Fedora.
Can you explain what is the severity of this bug and what is the use case for running commands like hostnamectl from a rpm scriptlet?
We do not control which program is executed from rpm scriptlets, especially for 3rd party packages.
For now there is no use case, but it would be good to browse the policy once to detect all search missing rules, i.e. where a source domain can send the message to a target domain but not get the response because the target domain cannot send back messages to source domain itself.
Ideally an automated script should check for such rules, e.g.:
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
# Get all rules
sesearch -A -c dbus -p send_msg > /tmp/dbus_send_msg.rules
# Print rules that don't have "reply rules"
while read _ src tgt _; do tgt=$(echo $tgt | cut -f1 -d':'); grep -q "^allow $tgt $src:dbus" /tmp/dbus_send_msg.rules || echo "$src -> $tgt OK but no $tgt -> $src"; done < /tmp/dbus_send_msg.rules
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
The script doesn't handle attributes, but the idea is here.
As no new information appeared during the past weeks, we are going to close this bug. If you need to pursue this matter further, feel free to reopen this bug and add justification.
Progress can be tracked in the following Fedora bz:
https://bugzilla.redhat.com/show_bug.cgi?id=2170059