From 38d16c97cf06fb3d3cff9b76a2122d90756418fb Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 8 May 2019 22:04:07 +0900 Subject: [PATCH] executor/oci: remove /proc masks for NoProcessSandBox mode Signed-off-by: Akihiro Suda --- executor/oci/spec_unix.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/executor/oci/spec_unix.go b/executor/oci/spec_unix.go index 08b0ee21..0d12a18d 100644 --- a/executor/oci/spec_unix.go +++ b/executor/oci/spec_unix.go @@ -95,6 +95,23 @@ func GenerateSpec(ctx context.Context, meta executor.Meta, mounts []executor.Mou Options: []string{"ro", "nosuid", "noexec", "nodev"}, }) + if processMode == NoProcessSandbox { + var maskedPaths []string + for _, s := range s.Linux.MaskedPaths { + if !hasPrefix(s, "/proc") { + maskedPaths = append(maskedPaths, s) + } + } + s.Linux.MaskedPaths = maskedPaths + var readonlyPaths []string + for _, s := range s.Linux.ReadonlyPaths { + if !hasPrefix(s, "/proc") { + readonlyPaths = append(readonlyPaths, s) + } + } + s.Linux.ReadonlyPaths = readonlyPaths + } + if meta.SecurityMode == pb.SecurityMode_INSECURE { //make sysfs rw mount for insecure mode. for _, m := range s.Mounts {