Re: c/r: prctl: Drop VMA flags test on PR_SET_MM_ stack data assignment

From: Kees Cook
Date: Thu Apr 26 2012 - 14:17:10 EST


On Thu, Apr 26, 2012 at 9:08 AM, Cyrill Gorcunov <gorcunov@xxxxxxxxx> wrote:
> From: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>
>
> With the
>
>  | commit b76437579d1344b612cf1851ae610c636cec7db0
>  | Author: Siddhesh Poyarekar <siddhesh.poyarekar@xxxxxxxxx>
>  | Date:   Wed Mar 21 16:34:04 2012 -0700
>  |
>  | procfs: mark thread stack correctly in proc/<pid>/maps
>
> the stack allocated via clone() is marked in /proc/<pid>/maps as
> [stack:%d] thus it might be out of the former mm->start_stack/end_stack
> values (and even has some custom VMA flags set). So to be able to
> restore mm->start_stack/end_stack drop vma flags test, but still
> require the undrlied VMA to exist.
>
> As always note this feature is under CONFIG_CHECKPOINT_RESTORE
> and requires CAP_SYS_RESOURCE to be granted.
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@xxxxxxxxxx>

It'd be nice if there was some sensible per-thread kernel record of
where the stack is expected to be. Regardless:

Acked-by: Kees Cook <keescook@xxxxxxxxxxxx>

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