lkml.org 
[lkml]   [2015]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] devpts: Add ptmx_uid and ptmx_gid options
Kenton Varda <kenton@sandstorm.io> writes:

> On Thu, May 28, 2015 at 1:06 PM, Alexander Larsson <alexl@redhat.com> 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


\
 
 \ /
  Last update: 2015-05-29 00:21    [W:0.060 / U:20.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site