Hi. I’m getting a really weird SELinux couple of denials upon boot to a new fresh installation of Fedora 39. I have not seen anything like this when I installed F39 or earlier on the very same machine before under a slightly different setup. The behavior is also different on this installation, more robust I would say. It’s asking for a DAC override?! For real? That’s disabling access controls. There’s also nothing like that (.#hwdb.bin5fda…) in /etc/udev/ folder. Who and what is asking for what in this??
I filed a bug Bug 2254815 - DAC override request from unknown source because this seems some sort of a security vulnerability to me that can be costing people lives. There should be nothing requesting full abrogation of DAC from systemd and hardware related I think. It’s suspicious at the very least.
That’s just a temporary file created by systemd-hwdb (tmpfn_random()) to update the hwdb atomically.
I’m not an SELinux expert, but I think a dac_override denial usually just means permissions are set incorrectly. Normally, root can access any file, but SELinux blocks that by default.
Whew I guess. The context on /etc/udev/hwdb.bin is unconfined_u:object_r:etc_t:s0 versus I would imagine the needed system_u:… Is that what’s causing the SELinux denial? What gets denied though? Everything is working fine.
I’d expect that hwdb.bin isn’t getting updated. Check systemctl status systemd-hwdb-update.
Does restorecon -v /etc/udev/hwdb.bin fix the context? It should be system_u:object_r:systemd_hwdb_etc_t:s0. Also, the unconfined_u doesn’t seem to matter. systemd-hwdb is apparently restricted to accessing files of type systemd_hwdb_etc_t within /etc.
I don’t know how this would have happened unless you booted with SELinux disabled. I’m assuming you would have mentioned that.
systemd-hwdb-update is inactive and the hw db rebuilding was skipped it says.
Why would I want to fix the context now? It seems to boot normal the way it is. Is there a point to fix the context and have the hwdb rebuilt?
I have NOT booted with SELinux disabled. Does booting the system in an nspawn container count? That would keep SELinux off.
What would even try to update the hwdb? It says that updating hwdb is needed only if you need specific behavior from a device – and none are needed as far as I know, never had to update it. And systemd-udev package ships with a hwdb.bin file already (not sure if it gets rebuilt during install).
The service runs if the first condition is met (/usr is newer than /etc, basically), along with at least one of the last three. Because Fedora puts hwdb.bin in /etc, two of those are met, and the first should be met on first boot and any time /usr’s mtime changes.
To be honest, I’m not sure why the hwdb isn’t in /usr.
Regardless, the hwdb is updated the same way (systemd-hwdb update) in an rpm file trigger, and that would likely fail for the same reason. In fact, that may be where the error is happening for you. The systemd-udev package itself uses udevadm hwdb --update, which probably isn’t similarly confined, but that doesn’t help for hwdb.d entries installed by other packages.
I’m not sure why this is either. I read that if you ship hwdb.bin you leave it in /usr, if you actively customize hwdb you then work with /etc. Why is Fedora putting hwdb.bin into /etc??
I guess this is concerning to me from the security point of view. I don’t want the hwdb be changed on boot and have behavior of my pretty important devices (including serial devices like an inbuilt keyboard) be customized without me asking for it specifically. Am I right to be concerned about this?