From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com ([74.125.82.65]:32813 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752518AbcGZK2G (ORCPT ); Tue, 26 Jul 2016 06:28:06 -0400 Subject: Re: [PATCH v2 00/10] userns: sysctl limits for namespaces To: "Eric W. Biederman" , Linux Containers References: <8737n5dscy.fsf@x220.int.ebiederm.org> <87d1m754jc.fsf@x220.int.ebiederm.org> Cc: mtk.manpages@gmail.com, Andy Lutomirski , Jann Horn , Kees Cook , Nikolay Borisov , "Serge E. Hallyn" , Seth Forshee , linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org From: "Michael Kerrisk (man-pages)" Message-ID: <94b608ae-1d06-5c41-cbd5-94e663a2163a@gmail.com> Date: Tue, 26 Jul 2016 12:27:59 +0200 MIME-Version: 1.0 In-Reply-To: <87d1m754jc.fsf@x220.int.ebiederm.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Hello Eric, On 07/21/2016 06:39 PM, Eric W. Biederman wrote: > > This patchset addresses two use cases: > - Implement a sane upper bound on the number of namespaces. > - Provide a way for sandboxes to limit the attack surface from > namespaces. > > The maximum sane case I can imagine is if every process is a fat > process, so I set the maximum number of namespaces to the maximum > number of threads. > > I make these limits recursive and per user namespace so that a > usernamespace root can reduce the limits further. If a user namespace > root raises the limit the limit in the parent namespace will be honored. > > I have cut this implementation to the bare minimum needed to achieve > these objectives. > > Does anyone know if there is a proper error code to return for resource > limit exceeded? I am currently using -EUSERS or -ENFILE but both of > those feel a little wrong. ENFILE certainly seems weird. I suppose my first question is: why two different errors? Some alternatives you might want to consider: E2BIG, EOVERFLOW, or (maybe) ERANGE. Cheers, Michael