]> git.baikalelectronics.ru Git - kernel.git/commit
userns: user namespaces: convert all capable checks in kernel/sys.c
authorSerge E. Hallyn <serge@hallyn.com>
Wed, 23 Mar 2011 23:43:22 +0000 (16:43 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Mar 2011 02:47:06 +0000 (19:47 -0700)
commit6660667bae526843359a680dd9253732c7fceffa
treed02dd477d94cdeaa42286dbeffcb60467fb30fb7
parent32f8de1fcd1600b3f5742c45249b48fd7b09d422
userns: user namespaces: convert all capable checks in kernel/sys.c

This allows setuid/setgid in containers.  It also fixes some corner cases
where kernel logic foregoes capability checks when uids are equivalent.
The latter will need to be done throughout the whole kernel.

Changelog:
Jan 11: Use nsown_capable() as suggested by Bastian Blank.
Jan 11: Fix logic errors in uid checks pointed out by Bastian.
Feb 15: allow prlimit to current (was regression in previous version)
Feb 23: remove debugging printks, uninline set_one_prio_perm and
make it bool, and document its return value.

Signed-off-by: Serge E. Hallyn <serge.hallyn@canonical.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Daniel Lezcano <daniel.lezcano@free.fr>
Acked-by: David Howells <dhowells@redhat.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/sys.c