google / google/gvisor

Incorrect "mount" in config.json is either silently ignored or crashes runsc

Open
#11,736 5 comments 0 reactions 0 assignees View on GitHub
stale-issue type: bug
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

### Description

```
"mounts": [
{
"destination": "/ddd",
"source": "/",
// and if we specify here "type": "bind", runsc crashes
}
]
```

does not do anything except creating empty directory.

Moreover, specifying `"type": "bind"` causes `runsc` to crash.

This is correct version, but this issue is about missing validation, if this configuration is not correct.

```
"mounts": [
{
"destination": "/ddd",
"source": "/",
"type": "bind",
"options": ["rbind", "rw"]
}
]
```

### Steps to reproduce

```
{
"process": {
"args": ["/bin/bash"],
"terminal": true
},
"root": {
"path": "/"
},
"mounts": [
{
"destination": "/ddd",
"source": "/"
}
]
}
```

```
$ sudo bazel-bin/runsc/runsc_/runsc run --bundle ~/bu2 cont-x

root@:/# ls -l /ddd
total 0

root@:/# mount
none on / type overlay (rw)
none on /sys type sysfs (rw,dentry_cache_limit=1000)
none on /dev type tmpfs (rw,mode=0755)
none on /proc type proc (rw,dentry_cache_limit=1000)
none on /dev/pts type devpts (rw)
```

Log: https://gist.github.com/stepancheg/82cee1f2095405d1c5b790240ad62564

```
{
"process": {
"args": ["/bin/bash"],
"terminal": true
},
"root": {
"path": "/"
},
"mounts": [
{
"destination": "/ddd",
"source": "/",
"type": "bind"
}
]
}
```

```
$ sudo bazel-bin/runsc/runsc_/runsc run --bundle ~/bu2 cont-x

running container: creating container: cannot create sandbox: cannot read client sync file: waiting for sandbox to start: EOF
```

Log: https://gist.github.com/stepancheg/81c05a3b18909e28716f6cee945c456e

### runsc version

```shell
runsc version release-20250505.0-31-gd30c58e5b8a4
spec: 1.2.0
```

### uname

Linux w-st 6.6.72+ #1 SMP PREEMPT_DYNAMIC Sat Apr 19 09:07:01 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

### repo state (if built from source)

release-20250505.0-31-gd30c58e5b

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.