Commit 79f0713d authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Linus Torvalds

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: default avatarMichael Kerrisk <mtk.manpages@gmail.com>
Acked-by: default avatarKees Cook <keescook@chromium.org>
Acked-by: default avatarMichael 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: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9bbad7da
...@@ -1706,7 +1706,7 @@ static int prctl_set_mm(int opt, unsigned long addr, ...@@ -1706,7 +1706,7 @@ static int prctl_set_mm(int opt, unsigned long addr,
if (arg4 | arg5) if (arg4 | arg5)
return -EINVAL; return -EINVAL;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_RESOURCE))
return -EPERM; return -EPERM;
if (addr >= TASK_SIZE) if (addr >= TASK_SIZE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment