• Serge E. Hallyn's avatar
    userns: security: make capabilities relative to the user namespace · 3486740a
    Serge E. Hallyn authored
    - Introduce ns_capable to test for a capability in a non-default
      user namespace.
    - Teach cap_capable to handle capabilities in a non-default
      user namespace.
    
    The motivation is to get to the unprivileged creation of new
    namespaces.  It looks like this gets us 90% of the way there, with
    only potential uid confusion issues left.
    
    I still need to handle getting all caps after creation but otherwise I
    think I have a good starter patch that achieves all of your goals.
    
    Changelog:
    	11/05/2010: [serge] add apparmor
    	12/14/2010: [serge] fix capabilities to created user namespaces
    	Without this, if user serge creates a user_ns, he won't have
    	capabilities to the user_ns he created.  THis is because we
    	were first checking whether his effective caps had the caps
    	he needed and returning -EPERM if not, and THEN checking whether
    	he was the creator.  Reverse those checks.
    	12/16/2010: [serge] security_real_capable needs ns argument in !security cas...
    3486740a
cred.c 21.9 KB