Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753661AbdHXTtM (ORCPT ); Thu, 24 Aug 2017 15:49:12 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:46751 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751615AbdHXTtL (ORCPT ); Thu, 24 Aug 2017 15:49:11 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Christian Brauner Cc: Al Viro , Serge Hallyn , Stefan Lippers-Hollmann , Christian Brauner , Thorsten Leemhuis , Linux Kernel Mailing List , Linus Torvalds References: <20170816171211.4021-1-christian.brauner@ubuntu.com> <87pobvruzt.fsf@xmission.com> <87ziazqdfr.fsf@xmission.com> <20170824022436.44adb497@mir> <87378hhi3y.fsf@xmission.com> <87wp5tfynr.fsf@xmission.com> <20170824062432.1e05e6f8@mir> <874lsxezal.fsf@xmission.com> <87y3q8ermg.fsf@xmission.com> Date: Thu, 24 Aug 2017 14:48:47 -0500 In-Reply-To: (Christian Brauner's message of "Thu, 24 Aug 2017 21:01:59 +0200") Message-ID: <87wp5sd9wg.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1dky7i-00080p-6t;;;mid=<87wp5sd9wg.fsf@xmission.com>;;;hst=in02.mta.xmission.com;;;ip=67.3.200.44;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX188DPrF5bEghyP79RvTYjY1uY/jri52ds4= X-SA-Exim-Connect-IP: 67.3.200.44 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 1.5 XMNoVowels Alpha-numberic number with no vowels * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa05 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_01 4+ unique symbols in subject * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_03 6+ unique symbols in subject X-Spam-DCC: XMission; sa05 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: **;Christian Brauner X-Spam-Relay-Country: X-Spam-Timing: total 5690 ms - load_scoreonly_sql: 0.05 (0.0%), signal_user_changed: 3.1 (0.1%), b_tie_ro: 2.1 (0.0%), parse: 1.27 (0.0%), extract_message_metadata: 19 (0.3%), get_uri_detail_list: 1.79 (0.0%), tests_pri_-1000: 9 (0.2%), tests_pri_-950: 1.60 (0.0%), tests_pri_-900: 1.26 (0.0%), tests_pri_-400: 25 (0.4%), check_bayes: 24 (0.4%), b_tokenize: 8 (0.1%), b_tok_get_all: 8 (0.1%), b_comp_prob: 2.4 (0.0%), b_tok_touch_all: 3.0 (0.1%), b_finish: 0.60 (0.0%), tests_pri_0: 140 (2.5%), check_dkim_signature: 0.55 (0.0%), check_dkim_adsp: 3.0 (0.1%), tests_pri_500: 5486 (96.4%), poll_dns_idle: 5477 (96.3%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1395 Lines: 33 Christian Brauner writes: > On Aug 24, 2017 20:41, "Eric W. Biederman" wrote: > > > The implementation of TIOCGPTPEER has two issues. > > > > When /dev/ptmx (as opposed to > > I've touched on this in my original message, I wonder whether we > currently support mounting devpts at a different a location and expect > an open on a newly created slave to work. Say I mount devpts at /mnt > and to open("/mnt/ptmx", O_RDWR | O_NOCTTY) and get a new slave pty at > /mnt/1 do we expect open("/mnt/1, O_RDWR | O_NOCTTY) to work? Yes. In particular one of my crazy test cases when I did the last round of cleanups to devpts was someone had created a chroot including a /dev/ptmx device node and mounted devpts at the appropriate path inside the chroot. Which is in part why /dev/ptmx does a relative lookup of the devpts filesystem. Now glibc won't work with devpts mounted somewhere else. As it has /dev/pts/... hardcoded. But the kernel should work fine. The case you described using /mnt/ptmx instead of a random /dev/ptmx device now should work especially well as none of this crazy relative path lookup work needs to happen. There are little things such as TIOCSPTLCK and perhaps chmod that need to be called in your example before the slave open will succeed (without O_PATH) but yes that case most definitely should work. Eric