• Eric W. Biederman's avatar
    userns: Simplify the user_namespace by making userns->creator a kuid. · 783291e6
    Eric W. Biederman authored
    - Transform userns->creator from a user_struct reference to a simple
      kuid_t, kgid_t pair.
    
      In cap_capable this allows the check to see if we are the creator of
      a namespace to become the classic suser style euid permission check.
    
      This allows us to remove the need for a struct cred in the mapping
      functions and still be able to dispaly the user namespace creators
      uid and gid as 0.
    
    - Remove the now unnecessary delayed_work in free_user_ns.
    
      All that is left for free_user_ns to do is to call kmem_cache_free
      and put_user_ns.  Those functions can be called in any context
      so call them directly from free_user_ns removing the need for delayed work.
    Acked-by: default avatarSerge Hallyn <serge.hallyn@canonical.com>
    Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
    783291e6
user_namespace.c 3.75 KB