Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754115AbbLTEgl (ORCPT ); Sat, 19 Dec 2015 23:36:41 -0500 Received: from terminus.zytor.com ([198.137.202.10]:44876 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbbLTEgk (ORCPT ); Sat, 19 Dec 2015 23:36:40 -0500 User-Agent: K-9 Mail for Android In-Reply-To: <87a8p54v3t.fsf@x220.int.ebiederm.org> References: <43AD2BA7-B594-4299-95F3-D86FD38AF21B@zytor.com> <87egexpf4o.fsf@x220.int.ebiederm.org> <1CB621EF-1647-463B-A144-D611DB150E15@zytor.com> <20151208223135.GA8352@kroah.com> <87oae0h2bo.fsf@x220.int.ebiederm.org> <56677DE3.5040705@zytor.com> <20151209012311.GA11794@kroah.com> <84B136DF-55E4-476A-9CB2-062B15677EE5@zytor.com> <20151209013859.GA12442@kroah.com> <20151209083225.GA30452@1wt.eu> <87wpskyds7.fsf_-_@x220.int.ebiederm.org> <566F1CD7.20502@hurleysoftware.com> <87y4cq6t1j.fsf@x220.int.ebiederm.org> <87a8p54v3t.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH] devpts: Sensible /dev/ptmx & force newinstance From: "H. Peter Anvin" Date: Sat, 19 Dec 2015 20:35:29 -0800 To: ebiederm@xmission.com, Peter Hurley CC: Greg KH , Jiri Slaby , Linus Torvalds , 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@vger.kernel.org Message-ID: <5AFEA8FF-BDEA-40AF-8C45-19F3E9CC36D3@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2173 Lines: 51 On December 19, 2015 8:11:50 PM PST, ebiederm@xmission.com wrote: >ebiederm@xmission.com (Eric W. Biederman) writes: > >>>> In that system ptys simply did not work after boot when I tested >>>> associating /dev/ptmx with the first mount of the devpts >filesystem. >>> >>> Assuming userspace isn't broken by that patch, is a fixed >association >>> with first mount otherwise an acceptable solution for magic >/dev/ptmx >>> (where /dev/ptmx is not a symlink to /dev/pts/ptmx)? >> >> I do not believe a fixed association with the first mount is an >> acceptable solution for implementing /dev/ptmx in association with >> a change to cause mount of devpts to be an independent filesystem. >> Such an association fails to be backwards compatible with existing >> userspace, and it is extremely fragile. > >Ugh. After reviewing the userspace code that mounts devpts we have >to do use a magic /dev/ptmx to solve the issue we are trying to solve. > >The fragility of detecting the primary system devpts seems solvable. > >CentOS5 and openwrt-15.05 mount devpts, unmount devpts, >then mount devpts again. So a rule of mouting the internal devpts if >it >isn't mounted would work for those. > >CentOS6 uses switch_root and moves it's early mount of devpts onto the >primary root, and then because devpts is also in /etc/fstab tries and >fails to mount devpts once more at the same location. Implying >newinstance will make that mounting devpts twice. That sounds solvable >but I don't see a clean way of detecting that case yet. > >Ugh. > >I am going to pound my head up against what is needed to find the >primary system mount of devpts for a bit more and see if I can solve >that. Otherwise this exercise is pointless. > >Eric Does it matter if it mounts devpts twice? It seems like a waste of a minuscule amount of memory, and nothing else. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/