Bug 1921579 - cannot boot: selinux blocks dbus-broker from starting
Summary: cannot boot: selinux blocks dbus-broker from starting
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dbus-broker
Version: 33
Hardware: Unspecified
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Tom Gundersen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-01-28 09:07 UTC by fattony4
Modified: 2021-02-25 09:01 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-19 15:25:51 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description fattony4 2021-01-28 09:07:34 UTC
Description of problem:

Fedora: 5.10.10-200.fc33.x86_64

Fedora won't boot anymore.

First boot error message: [FAILED] Failed to start D-Bus System Message Bus.
boot log: https://pastebin.com/wLQkDz3V

After disabling SElinux in /etc/sysconfig/selinux, it boots again.


Since the last working boot, I dnf updated a few packages.
dnf history: https://pastebin.com/uVFqvwF0

Output from journalctl -u dbus-broker.service for the relevant boot:
https://pastebin.com/ME6UkCmy

SElinux audit log (grep dbus /var/log/audit/audit.log): https://pastebin.com/fgnDXhE5



I have already tried uninstalling everything nvidia-related, and it didn't help.

Comment 1 fattony4 2021-02-03 11:38:57 UTC
Meanwhile, I have reinstalled dbus-common dbus-daemon and upgraded the kernel, but I still cannot enable SElinux.

Comment 2 Lee Packham 2021-02-16 08:44:30 UTC
In permissive I can boot - in enforced it is NOT possible.

Comment 3 David Rheinsberg 2021-02-17 13:01:10 UTC
The `dbus-broker-27` RPM in rawhide now improves this log-message and includes the file-path.

Until then, can you check whether `/usr/share/dbus-1/contexts/dbus_contexts/` is accessible by the `dbus` user, and that you did not place any files in there which have restricted access-modifiers?

Comment 4 fattony4 2021-02-18 17:06:03 UTC
I cannot find that folder: `/usr/share/dbus-1/contexts/`

Comment 5 David Rheinsberg 2021-02-19 07:58:38 UTC
(In reply to fattony4 from comment #4)
> I cannot find that folder: `/usr/share/dbus-1/contexts/`

Ah, sorry, those are stored in the SELinux directory. This should be `/etc/selinux/targeted/contexts/dbus_contexts`. Alternatively, `find / -name "dbus_contexts"` should be able to locate it.

Comment 6 fattony4 2021-02-19 09:41:01 UTC
(I know that I did not place any files in there.)

About `/etc/selinux/targeted/contexts/dbus_contexts`:
I could not log in as `dbus` user and check that way. Not sure the following output contains the answer to what you're looking for.


$ namei -l /etc/selinux/targeted/contexts/dbus_contexts
f: /etc/selinux/targeted/contexts/dbus_contexts
drwxr-xr-x root root /
drwxr-xr-x root root etc
drwxr-xr-x root root selinux
drwxr-xr-x root root targeted
drwxr-xr-x root root contexts
-rw-r--r-- root root dbus_contexts


$ stat /etc/selinux/targeted/contexts/dbus_contexts
  File: /etc/selinux/targeted/contexts/dbus_contexts
  Size: 195       	Blocks: 8          IO Block: 4096   regular file
Device: 23h/35d	Inode: 797311      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Context: system_u:object_r:default_context_t:s0
Access: 2021-02-18 17:59:34.086414561 +0100
Modify: 2021-01-15 11:23:04.000000000 +0100
Change: 2021-01-17 14:38:31.338905110 +0100
 Birth: 2021-01-17 14:38:31.338905110 +0100


$ ls -lZ /etc/selinux/targeted/contexts/dbus_contexts
-rw-r--r--. 1 root root system_u:object_r:default_context_t:s0 195 Jan 15 11:23 /etc/selinux/targeted/contexts/dbus_contexts


$ getfattr -m security.selinux -d /etc/selinux/targeted/contexts/dbus_contexts
# file: etc/selinux/targeted/contexts/dbus_contexts
security.selinux="system_u:object_r:default_context_t:s0"


If this is not useful, please tell me how to check.

Comment 7 fattony4 2021-02-19 10:17:04 UTC
I installed dbus-broker-27-2.fc35 from here: https://src.fedoraproject.org/rpms/dbus-broker

Here's the output from `journalctl -u dbus-broker.service`, with some comments added (##): https://pastebin.com/qfxzFUBU

Relevant line:
dbus-broker-launch[2130]: Access denied in /usr/share/dbus-1/system.d/com.teamviewer.TeamViewer.Daemon.conf +1: /usr/share/dbus-1/system.d/com.teamviewer.TeamViewer.Daemon.conf

It seems TeamViewer caused my problem! After uninstalling the package, I can enable SElinux again!

Thanks for your help.

Comment 8 David Rheinsberg 2021-02-19 15:25:51 UTC
(In reply to fattony4 from comment #7)
> I installed dbus-broker-27-2.fc35 from here:
> https://src.fedoraproject.org/rpms/dbus-broker
> 
> Here's the output from `journalctl -u dbus-broker.service`, with some
> comments added (##): https://pastebin.com/qfxzFUBU
> 
> Relevant line:
> dbus-broker-launch[2130]: Access denied in
> /usr/share/dbus-1/system.d/com.teamviewer.TeamViewer.Daemon.conf +1:
> /usr/share/dbus-1/system.d/com.teamviewer.TeamViewer.Daemon.conf
> 
> It seems TeamViewer caused my problem! After uninstalling the package, I can
> enable SElinux again!
> 
> Thanks for your help.

Thank you very much for confirming this! I assume TeamViewer was installed via a 3rd party repository? In that case, I will just close this. If this is actually part of Fedora, let me know and I will try to put the right people on CC.

Sorry for the delay, but I was tracking down some other bugs this week, and it took a few days. Thanks for the fast responses and trying the preliminary builds! If there is anything left for me to do, please don't hesitate to re-open this!

Comment 9 fattony4 2021-02-25 09:01:01 UTC
No problem, thanks for your effort!

I installed the TeamViewer rpm from https://www.teamviewer.com/download/linux/ some time ago. It automatically adds a repository.

I have tried to install it again, and it leads to the same error on boot.

Created a ticket on the TeamViewer community: https://community.teamviewer.com/English/discussion/111272/cannot-boot-with-teamviewer-installed-and-selinux-enabled/


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