[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <479FD11B-04D1-4EF0-B71B-6103A9CDB910@zytor.com>
Date: Tue, 19 Apr 2016 18:37:28 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Linus Torvalds <torvalds@...ux-foundation.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>
CC: Andy Lutomirski <luto@...capital.net>, security@...ian.org,
"security@...nel.org" <security@...nel.org>,
Al Viro <viro@...iv.linux.org.uk>,
"security@...ntu.com >> security" <security@...ntu.com>,
Peter Hurley <peter@...leysoftware.com>,
Serge Hallyn <serge.hallyn@...ntu.com>,
Willy Tarreau <w@....eu>,
Aurelien Jarno <aurelien@...el32.net>,
One Thousand Gnomes <gnomes@...rguk.ukuu.org.uk>,
Jann Horn <jann@...jh.net>, Greg KH <greg@...ah.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jiri Slaby <jslaby@...e.com>, Florian Weimer <fw@...eb.enyo.de>
Subject: Re: [PATCH 14/16] vfs: Implement mount_super_once
On April 19, 2016 6:24:12 PM PDT, Linus Torvalds <torvalds@...ux-foundation.org> wrote:
>On Tue, Apr 19, 2016 at 4:29 PM, Linus Torvalds
><torvalds@...ux-foundation.org> 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.
Powered by blists - more mailing lists