Re: [patch 3/3] [PATCH] prctl: Add PR_SET_MM codes to set up mm_struct entires v3

Kees Cook
2011-12-12T20:39:01Z

On Mon, Dec 12, 2011 at 12:06 PM, Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> When we restore a task we need to set up text, data and data
> heap sizes from userspace to the values a task had at
> checkpoint time. This patch adds auxilary prctl codes for that.
> ...
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>

Looks good; I like having this wrapped in CONFIG_CHECKPOINT_RESTORE.

> +#ifdef CONFIG_CHECKPOINT_RESTORE
> +static int prctl_set_mm(int opt, unsigned long addr,
> +                       unsigned long arg4, unsigned long arg5)
> ...
> +#else /* CONFIG_CHECKPOINT_RESTORE */
> +static int prctl_set_mm(int opt, unsigned long addr)

These need to have matching argument lists.

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

-Kees

--
Kees Cook
ChromeOS Security