[CRIU] [PATCH cr] mm: mark a vma as stack, if a value of sp is in it

Andrey Vagin avagin at openvz.org
Fri Sep 7 07:51:54 EDT 2012


/proc/PID/maps can contains not up to date information about a stack vma.
A kernel marks a VMA as stack, if thread_struct->usersp is in it,
but usersp is updated, when a process calls a syscall.

This problem is occured, when we try to dump/restore a process in a loop.
When a restorer resumes a process, a restorer vma will be marked as stack.

A thread stack should not be marked as stack, because its vma is mapped
w/o MAP_GROWSDOWN.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-dump.c      |    8 ++++++--
 cr-restore.c   |    2 ++
 include/util.h |    2 ++
 proc_parse.c   |    5 +----
 util.c         |   14 ++++++++++++++
 5 files changed, 25 insertions(+), 6 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mm-mark-a-vma-as-stack-if-a-value-of-sp-is-in-it.patch
Type: text/x-patch
Size: 3140 bytes
Desc: not available
Url : http://openvz.org/pipermail/criu/attachments/20120907/b2ae4f09/0001-mm-mark-a-vma-as-stack-if-a-value-of-sp-is-in-it.bin


More information about the CRIU mailing list