Skip to content

Cannot mount devpts or sysfs with a user namespace (as of v0.0.3) #225

@wking

Description

@wking

While adding user namespaces to my bundle, I had to drop the devpts and sysfs mounts from runC's default config, and I also had to drop ro from runC's default cgroup-mount options. Restoring them to my config.json.template leads to:

# runc config.json
Timestamp: 2015-08-24 16:47:34.679951846 -0700 PDT
Code: System error

Message: invalid argument

Frames:

---
0: setupRootfs
Package: github.com/opencontainers/runc/libcontainer
File: rootfs_linux.go@37

---
1: Init
Package: github.com/opencontainers/runc/libcontainer.(*linuxStandardInit)
File: standard_init_linux.go@52

---
2: StartInitialization
Package: github.com/opencontainers/runc/libcontainer.(*LinuxFactory)
File: factory_linux.go@242

---
3: init·1
Package: main
File: run.go@21

---
4: init
Package: main
File: utils.go@177

---
5: main
Package: runtime
File: proc.go@58

---
6: goexit
Package: runtime
File: asm_amd64.s@2232WARN[0000] signal: killed
FATA[0000] Container start failed: [8] System error: invalid argument
Makefile:11: recipe for target 'run' failed
make: *** [run] Error 1

with the devpts entry,

# runc config.json
Timestamp: 2015-08-24 16:46:33.526868472 -0700 PDT
Code: System error

Message: operation not permitted

Frames:

---
0: setupRootfs
Package: github.com/opencontainers/runc/libcontainer
File: rootfs_linux.go@37

---
1: Init
Package: github.com/opencontainers/runc/libcontainer.(*linuxStandardInit)
File: standard_init_linux.go@52

---
WARN[0000] signal: killed                               
FATA[0000] Container start failed: [8] System error: operation not permitted 
Makefile:11: recipe for target 'run' failed
make: *** [run] Error 1

with the sysfs entry, and:

# runc config.json
Timestamp: 2015-08-24 16:51:02.5931295 -0700 PDT
Code: System error

Message: operation not permitted

Frames:

---
0: setupRootfs
Package: github.com/opencontainers/runc/libcontainer
File: rootfs_linux.go@37

---
1: Init
Package: github.com/opencontainers/runc/libcontainer.(*linuxStandardInit)
File: standard_init_linux.go@52

---
2: StartInitialization
Package: github.com/opencontainers/runc/libcontainer.(*LinuxFactory)
File: factory_linux.go@242

---
3: init·1
Package: main
File: run.go@21

---
4: init
Package: main
File: utils.go@WARN[0000] signal: killed                               
FATA[0000] Container start failed: [8] System error: operation not permitted 
Makefile:11: recipe for target 'run' failed
make: *** [run] Error 1

with ro in the cgroups entry. I haven't been able to figure out why I'm getting these mount errors. If I drop my user namespacing, the errors go away. Is this a runC bug? A user-namespace limitation? A bug in my config template? I'm happy to help with further digging, but I could use a few hints pointing me in a useful direction. Perhaps this is what @LK4D4 was thinking about when he mentioned reconsidering default mounts for unprivileged functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions