-
-
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
Incorrect SELinux labels on Qubes-provided kernel module directory #4278
Comments
The modules.img is built here, at On the other hand, the problem shouldn't apply to kernel installed in VM ( |
@DemiMarie can you provide the list of changes you had to implement for selinux to work? |
The main reason for doing is that some users of QubesOS, especially as a server, benefit greately. For example, while QubesOS does a far better job of preventing a compromised Apache or NGINX from gaining complete control than Linux ever could, forensics is much easier if the attacker did not get root privileges on the VM they managed to compromise. Similarly, it is not practical to run one ProxyVM per AppVM, but one can easily run multiple sandboxed proxy instances in the same ProxyVM and use SELinux to separate them. Vulnerabilities that allow breaking out of a properly-constructed Linux sandbox are rare, as shown by Sandstorm. Sandstorm went at least a year without a single such vulnerability, and has probably gone more. |
@marmarek The correct fix is probably to apply extended attributes before building the image. |
This is necessary for qubes to work with SELinux enforcing, and fixes several bugs that appear even when SELinux is not enforcing. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
This is necessary for qubes to work with SELinux enforcing, and fixes several bugs that appear even when SELinux is not enforcing. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
All files in the dom0-provided kernel images should be owned by root:root, not user:mock! They also need to have proper SELinux contexts to be bootable with SELinux enforcing. Furthermore, an SELinux relabel can still damage the filesystem if the policy changes in the future; prevent that by marking the files immutable. fixes the UID and Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
All files in the dom0-provided kernel images should be owned by root:root, not user:mock! They also need to have proper SELinux contexts to be bootable with SELinux enforcing. Furthermore, an SELinux relabel can still damage the filesystem if the policy changes in the future; prevent that by marking the files immutable. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
All files in the dom0-provided kernel images should be owned by root:root, not user:mock! They also need to have proper SELinux contexts to be bootable with SELinux enforcing. Furthermore, an SELinux relabel can still damage the filesystem if the policy changes in the future; prevent that by marking the files immutable. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
All files in the dom0-provided kernel images should be owned by root:root, not user:mock! They also need to have proper SELinux contexts to be bootable with SELinux enforcing. Furthermore, an SELinux relabel can still damage the filesystem if the policy changes in the future; prevent that by marking the files immutable. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
All files in the dom0-provided kernel images should be owned by root:root, not user:mock! They also need to have proper SELinux contexts to be bootable with SELinux enforcing. Furthermore, an SELinux relabel can still damage the filesystem if the policy changes in the future; prevent that by marking the files immutable. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
All files in the dom0-provided kernel images should be owned by root:root, not user:mock! They also need to have proper SELinux contexts to be bootable with SELinux enforcing. Furthermore, an SELinux relabel can still damage the filesystem if the policy changes in the future; prevent that by marking the files immutable. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765
Automated announcement from builder-github The component
|
Automated announcement from builder-github The component
|
This is a combination of 10 commits: Fix filesystem metadata of dom0-provided kernels All files in the dom0-provided kernel images should be owned by root:root, not user:mock! They also need to have proper SELinux contexts to be bootable with SELinux enforcing. Furthermore, an SELinux relabel can still damage the filesystem if the policy changes in the future; prevent that by marking the files immutable. Fixes QubesOS/qubes-issues#4278 Fixes QubesOS/qubes-issues#5765 (cherry picked from commit 0d82ee5) Ensure that all inodes have sufficient permissions Since the entirety of /dev/xvdd is publicly accessible online, trying to hide anything in it is pointless. Fix this by ensuring that all files and symlinks have at least 0644 permissions, and that all directories have exactly 0755 permissions. The one exception is /lost+found, which should be 0700 for consistency with other ext3 filesystems. (cherry picked from commit 98e1e79) Error out on unusual inode types The dom0-provided kernel module directory should not contain anything that is not a regular file, directory, or symbolic link. If one does exist, it is a bug in the build process, so error out. (cherry picked from commit 4bb18b4) Fix build on R4.0 Fedora 25's gcc doesn't support `-fcf-protection`, `-fstack-clash-protection`, or `-fwrapv-pointer`. genfs runs on trusted input, so these flags are not necessary. Drop them. (cherry picked from commit d8f8a09) Skip . and .. in root_iterate_callback() This avoids causing problems for other code. (cherry picked from commit 3b134b7) /lib/modules/<kernel-version> must be writable depmod creates temporary files under it. (cherry picked from commit 4add7de) Reject unexpected paths in kernel module tree A dom0-provided kernel module directory should only have 7 entries: `.`, `..`, `vmlinuz`, `firmware`, `lost+found`, `initramfs`, and a directory with a name equal to the kernel version. Error out if there are any unexpected ones. (cherry picked from commit b637f76) Disable genfs on R4.0 It doesn't build and isn't needed. (cherry picked from commit 5be99b7) /lib/modules should be mutable The mount point of the modules filesystem can have new entries added to it, so it should be mutable. OverlayFS currently seems to ignore the immutable attribute on the lower directory, but this might be an OverlayFS bug, so don't rely on it. The immutable attribute is honored on subdirectories. (cherry picked from commit a9c159e) Only mark regular files and /lost+found immutable Marking other directories as immutable is too risky. (cherry picked from commit 3825161)
Automated announcement from builder-github The component
|
Automated announcement from builder-github The component
Or update dom0 via Qubes Manager. |
Automated announcement from builder-github The component
Or update dom0 via Qubes Manager. |
Automated announcement from builder-github The component
Or update dom0 via Qubes Manager. |
Automated announcement from builder-github The component
|
Automated announcement from builder-github The component
Or update dom0 via Qubes Manager. |
Qubes OS version:
R4.0
Affected component(s):
dom0 block devi
Steps to reproduce the behavior:
Enable SELinux in a TemplateVM (only tested with Fedora 28 so far).
Expected behavior:
Kernel modules load normally
Actual behavior:
Kernel modules fail to load
General notes:
Incorrect SELinux labelling in the filesystem mounted from
/var/lib/qubes/vm-kernels/*/modules.img
is the culprit.Related issues:
#4279, #4239
The text was updated successfully, but these errors were encountered: