opencontainers / opencontainers/runc

can't start nginx image with runc and user namespaces (works with crun)

Open
#4,475 16 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Trying to start a Kubernetes container with userns using the nginx official image, fails. This was reported here: https://github.com/containerd/containerd/issues/10598 by @ctrox.

@ctrox also found a workaround: add "tty: true" to the kubernetes pod makes it work.

And a simpler repro: just a container with userns that runs "cat /dev/stderr" also fails with permission denied.

I guess you need to run detached (as containerd does) to hit this, otherwise it uses your shell and that probably works.

@ctrox thanks for the great bug report!

Sorry the brevity, I'm sick ATM. I'll add more info when I recover

Steps to reproduce the issue

No response

Describe the results you received and expected

Works, as without user namespaces.

What version of runc are you using?

runc 1.2.0

Host OS information

No response

Host kernel information

No response

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 by reproducing the nginx container failure with user namespaces under runc 1.2.0, then compare it with crun and the simpler detached cat /dev/stderr case. Check whether adding tty: true changes the result; done means the userns container starts without that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes, linux, nginx
Domain
infrastructure, operating-systems, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.