Skip to content

/proc/self/fd/{0,1,2} are not valid (with --tty) #11462

@pwaller

Description

@pwaller

This is probably the root cause of #6880 and #8755.

Reproduced on 1.4.1 and 1.5.0.

Steps to reproduce:

$ docker run -ti --rm ubuntu ls -l /proc/self/fd
lrwx------ 1 root root 64 Mar 18 11:32 0 -> /25
lrwx------ 1 root root 64 Mar 18 11:32 1 -> /25
lrwx------ 1 root root 64 Mar 18 11:32 2 -> /25
lr-x------ 1 root root 64 Mar 18 11:32 3 -> /proc/1/fd

Expected: /fd/{0,1,2} symlinks should point to the same thing as docker run -ti --rm ubuntu tty.

Got: they point to some random point on the root of the filesystem which doesn't exist.

Effect: This breaks the command tty (and therefore tmux and various other programs) from a docker exec into the container. The reason is that readlink(/proc/self/fd/0) returns a path that doesn't exist. It also breaks any program which uses /dev/std{in,out,err}, because these are symlinks to items in the /proc/self/fd/ directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions