mirror of
https://github.com/containers/podman.git
synced 2025-09-19 21:50:07 +08:00
spec: mask /sys/kernel when bind mounting /sys
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
@ -132,6 +132,9 @@ func CreateConfigToOCISpec(config *CreateConfig) (*spec.Spec, error) { //nolint
|
||||
Options: []string{"rprivate", "nosuid", "noexec", "nodev", r, "rbind"},
|
||||
}
|
||||
g.AddMount(sysMnt)
|
||||
if !config.Privileged && isRootless {
|
||||
g.AddLinuxMaskedPaths("/sys/kernel")
|
||||
}
|
||||
}
|
||||
if isRootless {
|
||||
nGids, err := getAvailableGids()
|
||||
@ -500,7 +503,6 @@ func blockAccessToKernelFilesystems(config *CreateConfig, g *generate.Generator)
|
||||
"/proc/scsi",
|
||||
"/sys/firmware",
|
||||
"/sys/fs/selinux",
|
||||
"/sys/kernel",
|
||||
} {
|
||||
g.AddLinuxMaskedPaths(mp)
|
||||
}
|
||||
|
Reference in New Issue
Block a user