-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move bind-dirs to its own systemd unit file #5256
Comments
I wonder if it would be best to put at least some of this into the initramfs. That would avoid some potentially nasty race conditions. |
I don't think it's a good idea. In initramfs you don't have access to a some of the config files, root fs may be mounted still read only and most importantly, /rw isn't mounted yet, so you don't have what to bind mount. And no, moving |
Good catch! |
I like the idea. Disadvantage: Getting initramfs-generator specific.
In practice, it would probably need to be implemented for both, initramfs-tools and dracut.
This shouldn't be an issue. All initramfs-generators support configuration files available from the root disk. This wasn't even hard to implement. For example, we implemented something remotely similar (configuration files on the root disk, but needed at initramfs time) in security-misc:
Implementation can be seen here: Reasonable implementation effort and always has been stable. |
That doesn't work for dom0-provided kernel+initramfs. |
Indeed. So getting, done would be a prerequisite. Then this should be doable. |
Still, I think think moving bind-dirs (and by extension, the whole /rw setup, including mkfs/fsck etc) to initramfs is a very bad idea. Initramfs should do the bare minimum necessary to start init from the root filesystem and then switch to the normal init. Doing too much in initramfs is asking for troubles. Just a couple of them:
There are likely more. |
The issue with
mount-dirs.sh
is that it calls/usr/lib/qubes/init/bind-dirs.sh
which could execute malicious code through/rw/config/qubes-bind-dirs.d
which during a previous boot could have used to place a malicious malware hook. That can be fixed by moving bind-dirs into its own systemd unit file.Reason:
That would help to allow adding a systemd unit into the middle such as https://github.com/tasket/Qubes-VM-hardening or similar.
Related:
tasket/Qubes-VM-hardening#34
The text was updated successfully, but these errors were encountered: