aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sys.c
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@openvz.org>2012-03-15 18:17:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-03-15 20:03:03 -0400
commit79f0713d403c800db9d89134e2fd7f846e68d6ee (patch)
tree0c59c69742d70080f08d3c42febdf51b8db236ad /kernel/sys.c
parent9bbad7da76b3dd578fb55c862624366a8c9ccd22 (diff)
prctl: use CAP_SYS_RESOURCE for PR_SET_MM option
CAP_SYS_ADMIN is already overloaded left and right, so to have more fine-grained access control use CAP_SYS_RESOURCE here. The CAP_SYS_RESOUCE is chosen because this prctl option allows a current process to adjust some fields of memory map descriptor which rather represents what the process owns: pointers to code, data, stack segments, command line, auxiliary vector data and etc. Suggested-by: Michael Kerrisk <mtk.manpages@gmail.com> Acked-by: Kees Cook <keescook@chromium.org> Acked-by: Michael Kerrisk <mtk.manpages@gmail.com> Cc: Pavel Emelyanov <xemul@parallels.com> Cc: Tejun Heo <tj@kernel.org> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Paul Bolle <pebolle@tiscali.nl> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r--kernel/sys.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sys.c b/kernel/sys.c
index 40701538fbd1..888d227fd195 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1706,7 +1706,7 @@ static int prctl_set_mm(int opt, unsigned long addr,
1706 if (arg4 | arg5) 1706 if (arg4 | arg5)
1707 return -EINVAL; 1707 return -EINVAL;
1708 1708
1709 if (!capable(CAP_SYS_ADMIN)) 1709 if (!capable(CAP_SYS_RESOURCE))
1710 return -EPERM; 1710 return -EPERM;
1711 1711
1712 if (addr >= TASK_SIZE) 1712 if (addr >= TASK_SIZE)