cgroup: Add generic cgroup subsystem permission checks.
authorSan Mehat <san@google.com>
Thu, 21 May 2009 21:10:06 +0000 (14:10 -0700)
committerArve Hjønnevåg <arve@android.com>
Mon, 8 Feb 2010 23:09:13 +0000 (15:09 -0800)
commit5038d42d2e60c855cf5b097197d95adaa1269d32
treeeea89822f7ed83f9b11a6fe03a5e791d1087f70c
parent703932d07237252c0aca76ab693463664f0a71a3
cgroup: Add generic cgroup subsystem permission checks.

    Rather than using explicit euid == 0 checks when trying to move
tasks into a cgroup via CFS, move permission checks into each
specific cgroup subsystem. If a subsystem does not specify a
'can_attach' handler, then we fall back to doing our checks the old way.

    This way non-root processes can add arbitrary processes to
a cgroup if all the registered subsystems on that cgroup agree.

    Also change explicit euid == 0 check to CAP_SYS_ADMIN

Signed-off-by: San Mehat <san@google.com>
kernel/cgroup.c
kernel/cgroup_freezer.c
kernel/cpuset.c
kernel/sched.c