Re: [PATCH 2/3 v3] devpts: resolve devpts bind-mounts

2018-03-12 Thread Linus Torvalds
On Mon, Mar 12, 2018 at 1:10 PM, Christian Brauner wrote: >> >> So let's just change the behavior of devpts_mntget error if a mount with >> the pty underneath it can not be found. > > I'm sort of torn but I think I'd prefer changing the behavior too. The > /dev/ptmx, /dev/pts/ptmx schisma is reall

Re: [PATCH 2/3 v3] devpts: resolve devpts bind-mounts

2018-03-12 Thread Eric W. Biederman
Christian Brauner writes: > On Mon, Mar 12, 2018 at 02:52:53PM -0500, Eric W. Biederman wrote: >> Christian Brauner writes: >> >> > Most libcs will still look at /dev/ptmx when opening the master fd of a pty >> > device. When /dev/ptmx is a bind-mount of /dev/pts/ptmx and the TIOCGPTPEER >> > i

Re: [PATCH 2/3 v3] devpts: resolve devpts bind-mounts

2018-03-12 Thread Christian Brauner
On Mon, Mar 12, 2018 at 02:52:53PM -0500, Eric W. Biederman wrote: > Christian Brauner writes: > > > Most libcs will still look at /dev/ptmx when opening the master fd of a pty > > device. When /dev/ptmx is a bind-mount of /dev/pts/ptmx and the TIOCGPTPEER > > ioctl() is used to safely retrieve a

Re: [PATCH 2/3 v3] devpts: resolve devpts bind-mounts

2018-03-12 Thread Eric W. Biederman
Christian Brauner writes: > Most libcs will still look at /dev/ptmx when opening the master fd of a pty > device. When /dev/ptmx is a bind-mount of /dev/pts/ptmx and the TIOCGPTPEER > ioctl() is used to safely retrieve a file descriptor for the slave side of > the pty based on the master fd, the

[PATCH 2/3 v3] devpts: resolve devpts bind-mounts

2018-03-12 Thread Christian Brauner
Most libcs will still look at /dev/ptmx when opening the master fd of a pty device. When /dev/ptmx is a bind-mount of /dev/pts/ptmx and the TIOCGPTPEER ioctl() is used to safely retrieve a file descriptor for the slave side of the pty based on the master fd, the /proc/self/fd/{0,1,2} symlinks will