• David Howells's avatar
    keys: Move the user and user-session keyrings to the user_namespace · 0f44e4d9
    David Howells authored
    Move the user and user-session keyrings to the user_namespace struct rather
    than pinning them from the user_struct struct.  This prevents these
    keyrings from propagating across user-namespaces boundaries with regard to
    the KEY_SPEC_* flags, thereby making them more useful in a containerised
    environment.
    
    The issue is that a single user_struct may be represent UIDs in several
    different namespaces.
    
    The way the patch does this is by attaching a 'register keyring' in each
    user_namespace and then sticking the user and user-session keyrings into
    that.  It can then be searched to retrieve them.
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    cc: Jann Horn <jannh@google.com>
    0f44e4d9
keyring.c 46.3 KB