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 1797833 - Interactive sudo hangs waiting on fprintd after running "rpm --setperms dbus-daemon"
Summary: Interactive sudo hangs waiting on fprintd after running "rpm --setperms dbus-...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dbus
Version: 8.2
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: David King
QA Contact: Desktop QE
URL:
Whiteboard:
: 1811215 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-04 01:37 UTC by Shane Boulden
Modified: 2024-03-25 15:40 UTC (History)
8 users (show)

Fixed In Version: dbus-1.12.8-10.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:34:03 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4449 0 None None None 2020-11-04 01:34:08 UTC

Description Shane Boulden 2020-02-04 01:37:05 UTC
Description of problem:
Interactive sudo hangs waiting on fprintd after running the Essential 8 Ansible playbook against RHEL 8.2 hosts

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

How reproducible:
Every time

Steps to Reproduce:
1. Perform a new installation of RHEL 8.2 beta, and select "Australian Cyber Security Centre (ACSC) Essential Eight" from the Anaconda security profile selection
2. Once the system has provisioned, install the latest scap-security-guide content from Brew: http://download.eng.bos.redhat.com/brewroot/vol/rhel-8/packages/scap-security-guide/0.1.48/3.el8/noarch/scap-security-guide-0.1.48-3.el8.noarch.rpm
3. Update fapolicyd rules and restart the service:
sudo sed -i s/trust=1/''/g /etc/fapolicyd/fapolicyd.rules
sudo systemctl restart fapolicyd
4. Install ansible
sudo yum module install -y python36
pip install --user ansible
4. Run the e8 playbook against the host: ansible-playbook -i "localhost," -c local --ask-become-pass --become /usr/share/scap-security-guide/ansible/rhel8-playbook-e8.yml
5. Create a new SSH session to the host as a privileged user

Actual results:
User is permitted to login and 'sudo -i' immediately

Expected results:
User has to wait approximately 30 seconds for 'sudo -i' to present a password prompt

Additional info:
Work-around is to disable fprintd with authselect:
authselect select $(authselect current --raw) --force
authselect disable-feature with-fingerprint

Comment 3 Watson Yuuma Sato 2020-02-18 19:33:03 UTC
Hello Shane, apologies for the delay, and thank you for the excellent bug report.

I was able to reproduce your issue, and to track the issue down to the task for "rpm_verify_permissions".
In this task, it finds a few files that don't match the RPM database, and fixes it via "rpm --setperms <name of rpm>"

The cause of issue for me was "/run/dbus".

After install it has the following permissions:

[admin@localhost ~]$ ls -lhd /run/dbus
drwxr-xr-x. 2 root root 60 Feb 18 19:06 /run/dbus

After remediation, (i.e.: sudo rpm --setperms dbus-daemon):

[admin@localhost ~]$ ls -lhd /run/dbus
d---------. 2 root root 60 Feb 18 19:06 /run/dbus

And the issue with "sudo -i" occurs to me.

However, after a reboot the permissions of "/run/dbus" are reset to the same as before remediation, and I don't face the issue anymore.

Could you confirm if issue with "/run/dbus" happens with you too?
I don't know how your proposed workaround works around the issue though.

Comment 4 Shane Boulden 2020-02-19 03:52:05 UTC
Hi Watson,

You're correct. After remediation, "/run/dbus" has the following permissions:
[root@rhel8 ~]# ls -lhd /run/dbus
d---------. 2 root root 60 Feb 19 12:27 /run/dbus

>I don't know how your proposed workaround works around the issue though.

My understanding is that "sudo -i" is invoking fprintd, but as the daemon cannot access /run/dbus/system_bus_socket after 'rpm --setperms dbus-daemon, the command hangs (I see the following in 'journalctl -f'):

Feb 19 13:33:16 rhel8 systemd[1]: fprintd.service: Failed with result 'exit-code'.
Feb 19 13:33:16 rhel8 systemd[1]: Failed to start Fingerprint Authentication Daemon.
Feb 19 13:33:16 rhel8 sedispatch[848]: Connection Error (Failed to connect to socket /run/dbus/system_bus_socket: Permission denied): AVC Will be dropped
Feb 19 13:33:16 rhel8 sedispatch[848]: Connection Error (Failed to connect to socket /run/dbus/system_bus_socket: Permission denied): AVC Will be dropped

Hence the workaround effectively allows the prompt. Another option is to simply disable remove fprintd (yum remove fprintd) -> "sudo -i" presents a prompt immediately even though /run/dbus permissions are 'd---------.'

Comment 5 Watson Yuuma Sato 2020-02-19 12:06:30 UTC
Thanks for the analysis and explanation, Shane.

I believe "rpm --setperms dbus-daemon" shouldn't remove all permissions of "/run/dbus".
Reassigning bug to dbus.

Comment 6 Watson Yuuma Sato 2020-02-19 12:13:02 UTC
"rpm --setperms dbus-daemon" removes all permissions of "/run/dbus".

Following command works after install:
[admin@localhost ~]$ dbus-send --system --dest=org.freedesktop.DBus  --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
   array [
      string "org.freedesktop.DBus"
      string ":1.92"
[...]
      string ":1.103"
      string ":1.4"
   ]

After "rpm --setperms" command:
[admin@localhost ~]$ dbus-send --system --dest=org.freedesktop.DBus  --type=method_call --print-reply /org/freedesktop/DBus org.freedesktop.DBus.ListNames
Failed to open connection to "system" message bus: Failed to connect to socket /run/dbus/system_bus_socket: Permission denied


Notes:
After reboot permissions on "/run/dbus" are "755", so the dbus-send command works again.
But whenever SCAP Security Guide remediation is run, it will do "rpm --setperms dbus-daemon", and they will be fighting each other constantly.

Comment 8 David King 2020-03-11 15:37:43 UTC
Easy to fix, by creating %{buildroot}/run/dbus with default permissions (755) in the install phase.

Comment 9 David King 2020-03-18 09:49:52 UTC
*** Bug 1811215 has been marked as a duplicate of this bug. ***

Comment 15 Petr Schindler 2020-08-26 19:28:06 UTC
I could not reproduce original issue and all tests pass with fixing version of dbus.

Comment 19 errata-xmlrpc 2020-11-04 01:34:03 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 (dbus bug fix and enhancement update), 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-2020:4449


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