summaryrefslogtreecommitdiffhomepage
path: root/runsc/specutils
diff options
context:
space:
mode:
authorKonstantin Baranov <konstantin.baranov@workato.com>2020-10-26 18:02:52 -0700
committerKonstantin Baranov <konstantin.baranov@workato.com>2020-10-26 18:02:52 -0700
commit2b72da8bf95e3e1afb361f8984584bcf0524cff3 (patch)
tree49204fa30a9e8d20a9b4d0674a2bcab7a710268b /runsc/specutils
parent3fd4b83fa325de5e4e49c6fdcaa95a1a3db486ed (diff)
Allow overriding mount options for /dev and /dev/pts
This is useful to optionally set /dev ro,noexec. Treat /dev and /dev/pts the same as /proc and /sys. Make sure the Type is right though. Many config.json snippets on the Internet suggest /dev is tmpfs, not devtmpfs.
Diffstat (limited to 'runsc/specutils')
-rw-r--r--runsc/specutils/specutils.go8
1 files changed, 1 insertions, 7 deletions
diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go
index 5015c3a84..88b97f139 100644
--- a/runsc/specutils/specutils.go
+++ b/runsc/specutils/specutils.go
@@ -334,15 +334,9 @@ func IsSupportedDevMount(m specs.Mount) bool {
var existingDevices = []string{
"/dev/fd", "/dev/stdin", "/dev/stdout", "/dev/stderr",
"/dev/null", "/dev/zero", "/dev/full", "/dev/random",
- "/dev/urandom", "/dev/shm", "/dev/pts", "/dev/ptmx",
+ "/dev/urandom", "/dev/shm", "/dev/ptmx",
}
dst := filepath.Clean(m.Destination)
- if dst == "/dev" {
- // OCI spec uses many different mounts for the things inside of '/dev'. We
- // have a single mount at '/dev' that is always mounted, regardless of
- // whether it was asked for, as the spec says we SHOULD.
- return false
- }
for _, dev := range existingDevices {
if dst == dev || strings.HasPrefix(dst, dev+"/") {
return false