]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit - kernel/user_namespace.c
userns: Allow any uid or gid mappings that don't overlap.
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 28 Dec 2012 06:27:29 +0000 (22:27 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Sun, 27 Jan 2013 06:12:04 +0000 (22:12 -0800)
commit0bd14b4fd72afd5df41e9fd59f356740f22fceba
treebf1bc8dfa507ca40970927efb2dd87b4f5bdd416
parentc61a2810a2161986353705b44d9503e6bb079f4f
userns: Allow any uid or gid mappings that don't overlap.

When I initially wrote the code for /proc/<pid>/uid_map.  I was lazy
and avoided duplicate mappings by the simple expedient of ensuring the
first number in a new extent was greater than any number in the
previous extent.

Unfortunately that precludes a number of valid mappings, and someone
noticed and complained.  So use a simple check to ensure that ranges
in the mapping extents don't overlap.

Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
kernel/user_namespace.c