You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KubeVirt does not work with Talos Linux 1.9 #10083
There is no oportunity to disable selinux. (to make /sys/fs/selinux/enforce disapear completely)
but just having selinux fs mounted doesn;t mean it's enabled at all, you still need selinux=1 to enable it
And when SELinux loaded, KubeVirt can't work even withpermissive mode, because getxattr system call is blocked by Talos
Talos doesn't do anything in this regard, it probably kubevirt trying to access getxattr when selinux is not enabled
True. Mere existence of SELinux filesystem should not decline any permissions.
I will take a look at what KubeVirt does and whether or not SELinux could affect that in disabled mode but with selinuxfs, maybe if that's the case we should mount selinuxfs conditionally.
So okay, this means kubevirt breaks with selinuxfs mounted but policy not loaded. As I see from its code, it uses conventional Linux methods for querying SELinux (like getenforce from the container), which seem to interpret has selinuxfs but no policy as permissive mode.
From our side the fix should be not mounting selinuxfs when not enabling SELinux. This is what I am going to do right now. This change will likely be backported to 1.9 and released with the next point release.
So okay, this means kubevirt breaks with selinuxfs mounted but policy not loaded. As I see from its code, it uses conventional Linux methods for querying SELinux (like getenforce from the container), which seem to interpret has selinuxfs but no policy as permissive mode.
From our side the fix should be not mounting selinuxfs when not enabling SELinux. This is what I am going to do right now. This change will likely be backported to 1.9 and released with the next point release.
Activity
frezbo commentedon Jan 3, 2025
talos 1.9 has only selinux compiled and not even enabled at all, this is rather a an upstream issue on how they check if selinux is enabled
kvaps commentedon Jan 3, 2025
Hey @frezbo,
I have built Talos 1.9 using this config
https://github.com/aenix-io/cozystack/blob/c6edf6cb9ea828065885015e3a0b164ee3cddf1a/packages/core/installer/images/talos/profiles/installer.yaml
Selinux is enabled, but in
permissivemode:/sys/fs/selinux/enforcedisapear completely)permissivemode, becausegetxattrsystem call is blocked by Taloskvaps commentedon Jan 3, 2025
I just found similar issue in KubeVirt project
kubevirt/kubevirt#13607
frezbo commentedon Jan 3, 2025
but just having selinux fs mounted doesn;t mean it's enabled at all, you still need
selinux=1to enable itTalos doesn't do anything in this regard, it probably kubevirt trying to access
getxattrwhen selinux is not enabledfrezbo commentedon Jan 3, 2025
@dsseng tagging you here just to make sure we don't do anything wrong
dsseng commentedon Jan 3, 2025
True. Mere existence of SELinux filesystem should not decline any permissions.
I will take a look at what KubeVirt does and whether or not SELinux could affect that in disabled mode but with selinuxfs, maybe if that's the case we should mount selinuxfs conditionally.
kvaps commentedon Jan 3, 2025
Okay I found workaround:
dsseng commentedon Jan 3, 2025
So okay, this means kubevirt breaks with selinuxfs mounted but policy not loaded. As I see from its code, it uses conventional Linux methods for querying SELinux (like getenforce from the container), which seem to interpret
has selinuxfs but no policyas permissive mode.From our side the fix should be not mounting selinuxfs when not enabling SELinux. This is what I am going to do right now. This change will likely be backported to 1.9 and released with the next point release.
frezbo commentedon Jan 3, 2025
I also think upstream should do a better check
dsseng commentedon Jan 3, 2025
It also should. But actually mounting selinuxfs is not necessary and takes some time, even minor, so perhaps we better mount it conditionally.
fix: mount selinuxfs only when SELinux is enabled
fix: mount selinuxfs only when SELinux is enabled
fix: mount selinuxfs only when SELinux is enabled
fix: mount selinuxfs only when SELinux is enabled