mirror of
https://github.com/containers/podman.git
synced 2025-09-19 23:03:16 +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"},
|
Options: []string{"rprivate", "nosuid", "noexec", "nodev", r, "rbind"},
|
||||||
}
|
}
|
||||||
g.AddMount(sysMnt)
|
g.AddMount(sysMnt)
|
||||||
|
if !config.Privileged && isRootless {
|
||||||
|
g.AddLinuxMaskedPaths("/sys/kernel")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if isRootless {
|
if isRootless {
|
||||||
nGids, err := getAvailableGids()
|
nGids, err := getAvailableGids()
|
||||||
@ -500,7 +503,6 @@ func blockAccessToKernelFilesystems(config *CreateConfig, g *generate.Generator)
|
|||||||
"/proc/scsi",
|
"/proc/scsi",
|
||||||
"/sys/firmware",
|
"/sys/firmware",
|
||||||
"/sys/fs/selinux",
|
"/sys/fs/selinux",
|
||||||
"/sys/kernel",
|
|
||||||
} {
|
} {
|
||||||
g.AddLinuxMaskedPaths(mp)
|
g.AddLinuxMaskedPaths(mp)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user