]> git.baikalelectronics.ru Git - kernel.git/commit
userns: Ignore suid and sgid on binaries if the uid or gid can not be mapped
authorEric W. Biederman <ebiederm@xmission.com>
Tue, 22 Nov 2011 00:40:54 +0000 (16:40 -0800)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 19 Nov 2012 13:59:23 +0000 (05:59 -0800)
commit7960068fe345784193ef7335d7695d0128875c2a
tree8f6d5339dc7fc40107aecd11612617dbff63134e
parent69fd992ff2ab32a92a0b06658ae9ab838dda8afd
userns: Ignore suid and sgid on binaries if the uid or gid can not be mapped

When performing an exec where the binary lives in one user namespace and
the execing process lives in another usre namespace there is the possibility
that the target uids can not be represented.

Instead of failing the exec simply ignore the suid/sgid bits and run
the binary with lower privileges.   We already do this in the case
of MNT_NOSUID so this should be a well tested code path.

As the user and group are not changed this should not introduce any
security issues.

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