lkml.org 
[lkml]   [2012]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] prctl: Use CAP_SYS_RESOUCE for PR_SET_MM option
From
On Wed, Mar 7, 2012 at 4:52 AM, Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> CAP_SYS_ADMIN is already overloaded left and right,
> so to have more finegrained access control use
> CAP_SYS_RESOUCE 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
> represent what the process owns: pointers to
> code, data, stack segments, command line,
> auxilary vector data and etc.
>
> Suggested-by: Michael Kerrisk <mtk.manpages@gmail.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: Pavel Emelyanov <xemul@parallels.com>
> CC: Tejun Heo <tj@kernel.org>
> CC: Oleg Nesterov <oleg@redhat.com>
> CC: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> CC: Kees Cook <keescook@chromium.org>
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> ---
>  kernel/sys.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Index: linux-2.6.git/kernel/sys.c
> ===================================================================
> --- linux-2.6.git.orig/kernel/sys.c
> +++ linux-2.6.git/kernel/sys.c
> @@ -1712,7 +1712,7 @@ static int prctl_set_mm(int opt, unsigne
>        if (arg5 || (arg4 && opt != PR_SET_MM_AUXV))
>                return -EINVAL;
>
> -       if (!capable(CAP_SYS_ADMIN))
> +       if (!capable(CAP_SYS_RESOURCE))
>                return -EPERM;
>
>        if (addr >= TASK_SIZE)

Yeah, getting away from CAP_SYS_ADMIN is a good idea.

Acked-by: Kees Cook <keescook@chromium.org>

--
Kees Cook
ChromeOS Security
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-03-07 18:05    [W:0.081 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site