• Eric W. Biederman's avatar
    userns: Only allow the creator of the userns unprivileged mappings · f95d7918
    Eric W. Biederman authored
    If you did not create the user namespace and are allowed
    to write to uid_map or gid_map you should already have the necessary
    privilege in the parent user namespace to establish any mapping
    you want so this will not affect userspace in practice.
    
    Limiting unprivileged uid mapping establishment to the creator of the
    user namespace makes it easier to verify all credentials obtained with
    the uid mapping can be obtained without the uid mapping without
    privilege.
    
    Limiting unprivileged gid mapping establishment (which is temporarily
    absent) to the creator of the user namespace also ensures that the
    combination of uid and gid can already be obtained without privilege.
    
    This is part of the fix for CVE-2014-8989.
    
    Cc: stable@vger.kernel.org
    Reviewed-by: default avatarAndy Lutomirski <luto@amacapital.net>
    Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
    f95d7918
user_namespace.c 23.3 KB