mirror of
https://github.com/siderolabs/talos.git
synced 2025-12-08 02:51:29 +01:00
fix: mount selinuxfs only when SELinux is enabled
Having selinuxfs mounted might confuse some software, as conventional Linux systems do not have selinuxfs mounted when SELinux is disabled and no policy is loaded. Fixes #10083 Signed-off-by: Dmitry Sharshakov <dmitry.sharshakov@siderolabs.com>
This commit is contained in:
parent
5ccbf4bcdb
commit
ae6d065beb
@ -9,6 +9,7 @@ import (
|
||||
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/siderolabs/talos/internal/pkg/selinux"
|
||||
"github.com/siderolabs/talos/pkg/machinery/constants"
|
||||
)
|
||||
|
||||
@ -49,8 +50,8 @@ func PseudoSubMountPoints() Points {
|
||||
)
|
||||
}
|
||||
|
||||
if _, err := os.Stat("/sys/fs/selinux"); err == nil {
|
||||
// mount selinuxfs if it exists
|
||||
if selinux.IsEnabled() {
|
||||
// mount selinuxfs if it is enabled, which implies SELinux is the major LSM
|
||||
points = append(points,
|
||||
NewPoint("selinuxfs", "/sys/fs/selinux", "selinuxfs", WithFlags(unix.MS_NOSUID|unix.MS_NOEXEC|unix.MS_RELATIME)),
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user