Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753770AbcDINMU (ORCPT ); Sat, 9 Apr 2016 09:12:20 -0400 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:46390 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753218AbcDINMT (ORCPT ); Sat, 9 Apr 2016 09:12:19 -0400 Date: Sat, 9 Apr 2016 14:09:09 +0100 From: One Thousand Gnomes To: ebiederm@xmission.com (Eric W. Biederman) Cc: Linus Torvalds , "H. Peter Anvin" , Peter Hurley , Greg KH , Jiri Slaby , Aurelien Jarno , Andy Lutomirski , Florian Weimer , Al Viro , Serge Hallyn , Jann Horn , "security\@kernel.org" , "security\@ubuntu.com \>\> security" , security@debian.org, Willy Tarreau , Linux Kernel Mailing List Subject: Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup Message-ID: <20160409140909.42315e6d@lxorguk.ukuu.org.uk> In-Reply-To: <87twjcorwg.fsf@x220.int.ebiederm.org> References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <1459819769-30387-1-git-send-email-ebiederm@xmission.com> <87twjcorwg.fsf@x220.int.ebiederm.org> Organization: Intel Corporation X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 748 Lines: 21 > If anyone has a better idea on how userspace should connect the master > pty file descriptor the slave file descriptor, I would be willing to > implement that instead. If we are willing to go away from the existing mess of a tty interface inflicted on us by BSD and then mashed up by POSIX then a syscall of int err = ptypair(int fd[2], int perms, int flags); [where flags is the O_ ones we usually need to cover (CLOEXEC etc) and maybe even some kind of "private" flag to say don't even expose it via devpts). would do remarkably sane things to the majoirty of use cases as it breaks the dependence on grantpt and also the historic screwup that pty pairs aren't allocated atomically with both file handles returned as pipe() does. Alan