Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753798AbcDTEtz (ORCPT ); Wed, 20 Apr 2016 00:49:55 -0400 Received: from mail-ig0-f196.google.com ([209.85.213.196]:36428 "EHLO mail-ig0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753011AbcDTEtx (ORCPT ); Wed, 20 Apr 2016 00:49:53 -0400 MIME-Version: 1.0 In-Reply-To: References: <878u0s3orx.fsf_-_@x220.int.ebiederm.org> <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> <570D4781.3070600@zytor.com> <877ffyzy1j.fsf_-_@x220.int.ebiederm.org> <87twixgsnq.fsf@x220.int.ebiederm.org> <87oa95gevf.fsf_-_@x220.int.ebiederm.org> Date: Tue, 19 Apr 2016 21:49:52 -0700 X-Google-Sender-Auth: T0jcuOOGjCggYz_zTygpOl0EjuE Message-ID: Subject: Re: [PATCH] devpts: Make each mount of devpts an independent filesystem. From: Linus Torvalds To: Konstantin Khlebnikov Cc: "Eric W. Biederman" , "H. Peter Anvin" , 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 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: 893 Lines: 21 On Tue, Apr 19, 2016 at 9:36 PM, Konstantin Khlebnikov wrote: > On Wed, Apr 20, 2016 at 6:04 AM, Eric W. Biederman >> >> The kernel.pty.reserve sysctl is neutered with no way currently >> implemented to be able to use the reserved ptys. > > I think we could convert this into reserve for init user namespace, > ssh in host will work even if containers eaten all ptys. Yes. That's basically how it effectively worked before (ie everything but the initial non-newinstance devpts mount would be limited to the non-reserved numbers). We required the non-init namespaces to do a newinstance mount, so the whole test for "newinstance" was effectively the same thing as just checking for the init namespace from a security standpoint. And in fact, rewriting it in that form (ie checking for init_ns) would just make it much more obvious what the intent it. Linus