From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754929AbbE1Vzo (ORCPT ); Thu, 28 May 2015 17:55:44 -0400 Received: from out03.mta.xmission.com ([166.70.13.233]:39562 "EHLO out03.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754667AbbE1Vzj (ORCPT ); Thu, 28 May 2015 17:55:39 -0400 From: ebiederm@xmission.com (Eric W. Biederman) To: Kenton Varda Cc: Alexander Larsson , gnome-os-list@gnome.org, Linux Containers , "linux-kernel\@vger.kernel.org" , Andy Lutomirski , James Bottomley , mclasen@redhat.com, Linux FS Devel References: <1427788642.4411.12.camel@redhat.com> <1427807248.2117.117.camel@HansenPartnership.com> <1427808184.2117.122.camel@HansenPartnership.com> <1427810118.2117.126.camel@HansenPartnership.com> <1427810886.2117.129.camel@HansenPartnership.com> <1427811444.4411.20.camel@redhat.com> <1427969525.3559.120.camel@HansenPartnership.com> <1427984969.13651.11.camel@redhat.com> <87zj6qs7v8.fsf@x220.int.ebiederm.org> <87oal4odne.fsf@x220.int.ebiederm.org> <1432832511.21304.6.camel@redhat.com> <87mw0omxp0.fsf@x220.int.ebiederm.org> <1432843577.9873.1.camel@redhat.com> Date: Thu, 28 May 2015 16:50:37 -0500 In-Reply-To: (Kenton Varda's message of "Thu, 28 May 2015 13:17:30 -0700") Message-ID: <87oal4e5hu.fsf@x220.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-AID: U2FsdGVkX18bzZfsouc3lVaO2ftZ5nbz5ZNWbe4iJAs= X-SA-Exim-Connect-IP: 67.3.205.90 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.0 TVD_RCVD_IP Message was received from an IP address * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa07 1397; Body=1 Fuz1=1 Fuz2=1] X-Spam-DCC: XMission; sa07 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;Kenton Varda X-Spam-Relay-Country: X-Spam-Timing: total 226 ms - load_scoreonly_sql: 0.19 (0.1%), signal_user_changed: 5.0 (2.2%), b_tie_ro: 3.3 (1.5%), parse: 1.34 (0.6%), extract_message_metadata: 13 (5.8%), get_uri_detail_list: 1.23 (0.5%), tests_pri_-1000: 5.0 (2.2%), tests_pri_-950: 1.43 (0.6%), tests_pri_-900: 1.14 (0.5%), tests_pri_-400: 20 (8.8%), check_bayes: 19 (8.4%), b_tokenize: 6 (2.5%), b_tok_get_all: 6 (2.7%), b_comp_prob: 1.88 (0.8%), b_tok_touch_all: 3.1 (1.4%), b_finish: 0.66 (0.3%), tests_pri_0: 169 (74.8%), tests_pri_500: 6 (2.7%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] devpts: Add ptmx_uid and ptmx_gid options X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Wed, 24 Sep 2014 11:00:52 -0600) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Kenton Varda writes: > On Thu, May 28, 2015 at 1:06 PM, Alexander Larsson wrote: >> On Thu, 2015-05-28 at 12:14 -0500, Eric W. Biederman wrote: >>> >>> > Where does the second namespace enter into this? >>> >>> Step a. Create create a user namespace where uid 0 is mapped to your >>> real uid, and set up your sandbox (aka mount /dev/pts and everything >>> else). >>> >>> Step b. Create a nested user namespace where your uid is identity >>> mapped and run your desktop application. You can even drop all caps >>> in >>> your namespace. >> >> Just tried this. Its not the nicest, and it doubles the number of >> namespaces in action for each sandbox, but it does work. > > How much overhead is involved in each user namespace? sizeof(struct user_namespace). > Is there any system-wide limit on total namespaces, other than RAM? There is a system-wide maximum depth, but not count. > Is there > (non-negligible) CPU overhead for each syscall seeking permissions in > the namespace? ns_capable(ns, X) in some cases can walk up the from a starting user namespace to the initial user. (The only non-constant operation I am aware of). However unless the user namespace depth is deep it should still take a negligible amount of time. Eric