Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754532AbcDTBok (ORCPT ); Tue, 19 Apr 2016 21:44:40 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49556 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932567AbcDTBky (ORCPT ); Tue, 19 Apr 2016 21:40:54 -0400 User-Agent: K-9 Mail for Android In-Reply-To: References: <877ffyzy1j.fsf_-_@x220.int.ebiederm.org> <1460734532-20134-1-git-send-email-ebiederm@xmission.com> <1460734532-20134-14-git-send-email-ebiederm@xmission.com> <8737qhpifz.fsf@x220.int.ebiederm.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH 14/16] vfs: Implement mount_super_once From: "H. Peter Anvin" Date: Tue, 19 Apr 2016 18:37:28 -0700 To: Linus Torvalds , "Eric W. Biederman" CC: 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 Message-ID: <479FD11B-04D1-4EF0-B71B-6103A9CDB910@zytor.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2338 Lines: 69 On April 19, 2016 6:24:12 PM PDT, Linus Torvalds wrote: >On Tue, Apr 19, 2016 at 4:29 PM, Linus Torvalds > wrote: >> >> I _violently_ oppose the stupid DEVPTS_MULTIPLE_INSTANCES config >option. > >So just to show what I want to actually happen, here's the hacky patch >on top of my (now merged) cleanup patch that actually does what I want >devpts to do. > >I say it's hacky, because the "follow_mount()" thing there really is >pretty hacky. Al - suggestions for how to do this *right*? > >But this actually forcibly removes the whole "newinstance" thing, and >makes every pts mount a new instance, and just relies on "ptmx" doing >the right thing. > >In other words, with this patch, you can *literally* do just this (as >root, obviously): > > mkdir test-dir > cd test-dir > > mknod ptmx c 5 2 > mkdir pts > mount -t devpts pts pts > >and after that it all just works. You can do this: > > ls -l pts > >which shows just the other ptmx noode (that is unused and pointless - >I'd actually like to just remove it, but whatever), and then you can >do > > sleep 100 < ptmx & > sleep 100 < ptmx & > ls -l pts > >and you will magically see those new 0/1 entries in that pts >subdirectory.. It's entirely independent of /dev/pts/, and there's no >magic connection or any magic dis-connection. It all JustWorks(tm). > >Note how this works even *outside* of /dev. But it works inside of >/dev equally well. > >Now, a *real* patch would > > - solve that "follow_mount()" issue some other way > > - not remove the newinstance code immediately (I did it to show that >even the bootup works with a unmodified distro) > > - actually remove the whole "DEVPTS_MULTIPLE_INSTANCES" config option > > - I'm not happy with devpts_pty_kill(). I would want to clean that up >a bit somehow. I think this is at least partly what Peter Hurley was >talking about. That thing is not pretty. > >so this attached patch is by no means meant to be applied as-is. But >it's meant to show what (a) the new organization allows and (b) what I >was going for. > > Linus I say let's remove it unless ptmxmode= is specified. That way we don't break people who actually did the symlink thing. -- Sent from my Android device with K-9 Mail. Please excuse brevity and formatting.