mirror of https://github.com/containers/podman.git
spec: add nosuid,noexec,nodev to ro bind mount
runc fails to change the ro mode of a rootless bind mount if the other flags are not kept. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
36d96c19f9
commit
b3e7be7a0b
|
@ -227,7 +227,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
|
||||||
Options: []string{"bind", "private"},
|
Options: []string{"bind", "private"},
|
||||||
}
|
}
|
||||||
if c.IsReadOnly() && dstPath != "/dev/shm" {
|
if c.IsReadOnly() && dstPath != "/dev/shm" {
|
||||||
newMount.Options = append(newMount.Options, "ro")
|
newMount.Options = append(newMount.Options, "ro", "nosuid", "noexec", "nodev")
|
||||||
}
|
}
|
||||||
if !MountExists(g.Mounts(), dstPath) {
|
if !MountExists(g.Mounts(), dstPath) {
|
||||||
g.AddMount(newMount)
|
g.AddMount(newMount)
|
||||||
|
|
Loading…
Reference in New Issue