Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752171AbeADFyJ (ORCPT + 1 other); Thu, 4 Jan 2018 00:54:09 -0500 Received: from mail-yw0-f194.google.com ([209.85.161.194]:36562 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751829AbeADFyG (ORCPT ); Thu, 4 Jan 2018 00:54:06 -0500 X-Google-Smtp-Source: ACJfBovTDAB6H97kZp9t7LDfCjftZwLXvjFkd3yd/E2ZRk1X9fVvwOMddQGM2r5C6aIYuiBQhztsry8KIvNJFLGXLnY= MIME-Version: 1.0 In-Reply-To: <87po6qzycp.fsf@xmission.com> References: <20180103072642.161742-1-mahesh@bandewar.net> <87po6qzycp.fsf@xmission.com> From: =?UTF-8?B?TWFoZXNoIEJhbmRld2FyICjgpK7gpLngpYfgpLYg4KSs4KSC4KSh4KWH4KS14KS+4KSwKQ==?= Date: Wed, 3 Jan 2018 21:53:45 -0800 Message-ID: Subject: Re: [PATCHv4 0/2] capability controlled user-namespaces To: "Eric W. Biederman" Cc: Mahesh Bandewar , LKML , James Morris , Netdev , Kernel-hardening , Linux API , Linux Security , Serge Hallyn , Michael Kerrisk , Kees Cook , Eric Dumazet , David Miller Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 3, 2018 at 8:44 AM, Eric W. Biederman wrote: > Mahesh Bandewar writes: > >> From: Mahesh Bandewar >> >> TL;DR version >> ------------- >> Creating a sandbox environment with namespaces is challenging >> considering what these sandboxed processes can engage into. e.g. >> CVE-2017-6074, CVE-2017-7184, CVE-2017-7308 etc. just to name few. >> Current form of user-namespaces, however, if changed a bit can allow >> us to create a sandbox environment without locking down user- >> namespaces. > > In other conversations it appears it has been pointed out that user > namespaces are not necessarily safe under no_new_privs. In theory > user namespaces should be safe but in practice not so much. > > So let me ask. Would your concerns be addressed if we simply made > creation and joining of user namespaces impossible in a no_new_privs > sandbox? > Isn't this another form of locking down user-ns similar to setting per user-ns sysctl max_userns = 0? Having said that, not allowing processes to create and/or attach user-namespaces is going to be problematic and possibly a regression. This (current) patchset doesn't do that. It allows users to create user-ns's of any depth and number permitted by per-ns max_userns sysctl. However one can decide what to take-off and what to leave in terms of capabilities for the sandbox environment. --mahesh.. > Eric > [...]