Skip to content

Using userns-remap option when username & UID are the same causes containers to not run since 20.10.0 #42003

Description

@Rid

Description

The userns option uses an append of the UID and username (I guess the use case of using a username & UID which are the same was not considered). When both match this causes an issue where namespaced containers will no longer start.

Steps to reproduce the issue:

  1. echo "10426:x:10426:10426::/nonexistent:/bin/false" >> /etc/passwd
  2. echo "10426:x:10426:" >> /etc/group
  3. echo "10426:10426000:10000" >> /etc/subuid
  4. echo "10426:10426000:10000" >> /etc/subgid
  5. dockerd --userns-remap=10426 &
  6. docker run hello-world

Describe the results you received:
ERRO[2021-02-09T16:00:21.363273000Z] Handler for POST /v1.30/containers/ead4e0053b76f9ea88f03bb0c0cfc3af40c6c4717c625d70cbfe4a8f29b5fa42/start returned error: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:338: getting the final child's pid from pipe caused: EOF: unknown

Describe the results you expected:
The container to start successfully

Additional information you deem important (e.g. issue happens only occasionally):
This started with docker 20.10.0 following the commit 7ad0da7

Output of docker version:

Client: Docker Engine - Community
 Version:           20.10.3
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        48d30b5
 Built:             Fri Jan 29 14:33:21 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       eeddea2
  Built:            Tue Dec  8 18:57:45 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker info:

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.5.1-docker)

Server:
 Containers: 12
  Running: 12
  Paused: 0
  Stopped: 0
 Images: 12
 Server Version: 20.10.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
  userns
 Kernel Version: 5.10.13-051013-generic
 Operating System: Ubuntu 20.04.2 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 11.47GiB
 Name: test.ssd.local.cylo.net
 ID: CRII:VLIT:JYPX:DF6I:2F7A:NJDB:NMN2:54QI:UB63:DXBA:GE3V:JZ3J
 Docker Root Dir: /var/lib/docker/100000.100000
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio weight support
WARNING: No blkio weight_device support
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled

Additional environment details (AWS, VirtualBox, physical, etc.):

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