opencontainers / opencontainers/runc

Add validations `user.max_user_namespaces` and `kernel.pid_max` for rootless containers

Open
#3,666 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/rootless
Dominant language
Go
Stars
13.5k
Forks
2.3k
Avg merge
2d 8h
Merged PRs (30d)
30

Description

Rootless containers need to create namespace in user space as the README already mentions. If one of,

  • user.max_user_namespaces
  • kernel.pid_max

is zero, you end up with the following error:

Error response from daemon: OCI runtime create failed: container_linux.go:367: starting container process caused: process_linux.go:352: getting the final child's pid from pipe caused: EOF: unknown

The error say that I'm starving for namespaces or PIDs! To make UX better on this,

  • we can validate both of variables from sysctl in runtime (ensure not zero)
  • better error message: user namespace starvation! consider increase user.max_user_namespaces

For example, https://github.com/docker-library/docker/blob/75036d19c3d68de7d20277d707763f32ddd487aa/dockerd-entrypoint.sh#L171-L178

Test version: v1.0.0-rc93

Ref: https://github.com/moby/moby/issues/40835#issuecomment-730981130

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the rootless-container guidance in README and the error path in libcontainer/process_linux.go, then inspect how sysctl values are accessed. Done means zero user.max_user_namespaces or kernel.pid_max values are detected and produce a clear remediation message, with coverage for both cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.