Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754126AbcDTASe (ORCPT ); Tue, 19 Apr 2016 20:18:34 -0400 Received: from mail-ig0-f195.google.com ([209.85.213.195]:33557 "EHLO mail-ig0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754083AbcDTASc (ORCPT ); Tue, 19 Apr 2016 20:18:32 -0400 MIME-Version: 1.0 In-Reply-To: <5716C19B.1030500@zytor.com> References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <20160409140909.42315e6d@lxorguk.ukuu.org.uk> <83FE8CD2-C0A2-4ADB-AEBD-8DD89AD4F88A@zytor.com> <87bn5ij0x1.fsf@x220.int.ebiederm.org> <78205895-E11D-417F-91DC-4BCA0B61A122@zytor.com> <570D4781.3070600@zytor.com> <877ffyzy1j.fsf_-_@x220.int.ebiederm.org> <87inzdmo9z.fsf_-_@x220.int.ebiederm.org> <5716C19B.1030500@zytor.com> Date: Tue, 19 Apr 2016 17:18:26 -0700 X-Google-Sender-Auth: bQSIZORGuKR393WTQKSU5Ysp_FA Message-ID: Subject: Re: Does anyone care about a race free ptsname? From: Linus Torvalds To: "H. Peter Anvin" Cc: "Eric W. Biederman" , Andy Lutomirski , security@debian.org, "security@kernel.org" , Al Viro , "security@ubuntu.com >> security" , Peter Hurley , Serge Hallyn , Willy Tarreau , Aurelien Jarno , One Thousand Gnomes , Jann Horn , Greg KH , Linux Kernel Mailing List , Jiri Slaby , Florian Weimer Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 555 Lines: 16 On Tue, Apr 19, 2016 at 4:39 PM, H. Peter Anvin wrote: > > What do you think of the idea of TIOCPTSOPEN (or whatever) to get a file > descriptor for the slave device given the master device? Then we can > use realpath() or a readlink on /proc/self/fd/# to get the pathname if > needed. That sounds reasonable to me. > (Incidentally, we added getcwd() as a system call. Should we add > [f]realpath() as a system call too?) Probably a good idea. It's kind of silly to have to do a sprintf followed by a readlink(). Linus