Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755217AbcDKUMp (ORCPT ); Mon, 11 Apr 2016 16:12:45 -0400 Received: from mail-oi0-f49.google.com ([209.85.218.49]:35924 "EHLO mail-oi0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754683AbcDKUMm (ORCPT ); Mon, 11 Apr 2016 16:12:42 -0400 MIME-Version: 1.0 In-Reply-To: References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <1459819769-30387-1-git-send-email-ebiederm@xmission.com> <87twjcorwg.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> From: Andy Lutomirski Date: Mon, 11 Apr 2016 13:12:22 -0700 Message-ID: Subject: Re: [PATCH 01/13] devpts: Teach /dev/ptmx to find the associated devpts via path lookup To: Linus Torvalds Cc: security@debian.org, "security@kernel.org" , Al Viro , "security@ubuntu.com >> security" , Peter Hurley , "Eric W. Biederman" , Serge Hallyn , Willy Tarreau , Aurelien Jarno , One Thousand Gnomes , Jann Horn , Greg KH , Linux Kernel Mailing List , Jiri Slaby , Florian Weimer , "H. Peter Anvin" 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: 1048 Lines: 26 On Sat, Apr 9, 2016 at 6:27 PM, Linus Torvalds wrote: > > On Apr 9, 2016 5:45 PM, "Andy Lutomirski" wrote: >> >> >> What we *do* want to do, though, is to prevent the following: > > I don't see the point. Why do you bring up this insane scenario that nobody > can possibly care about? > > So you actually have any reason to believe somebody does that? > > I already asked about that earlier, and the silence was deafening. I have no idea, but I'm generally uncomfortable with magical things that bypass normal security policy. That being said, here's an idea for fixing this, at least in the long run. Add a new devpts mount option "no_ptmx_redirect" that turns off this behavior for the super in question. That is, opening /dev/ptmx if "pts/ptmx" points to something with no_ptmx_redirect set will fail. Distros shipping new kernels could be encouraged to (finally!) make /dev/ptmx a symlink and set this option. We just might be able to get away with spelling that option "newinstance".