2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

vdso: dump -- Don't dump contents of vvar zone

vvar zone is mapped by a kernel and must not ever
been dumped into image, the data present there is
valid on running kernel only.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Cyrill Gorcunov 2014-06-20 19:35:05 +04:00 committed by Pavel Emelyanov
parent 72ead490e4
commit 0bb002ce69
2 changed files with 20 additions and 0 deletions

View File

@ -94,6 +94,11 @@ bool privately_dump_vma(struct vma_area *vma)
if (vma->e->status & VMA_AREA_SYSVIPC)
return false;
#ifdef CONFIG_VDSO
/* No dumps for vDSO VVAR data */
if (vma->e->status & VMA_AREA_VVAR)
return false;
#endif
if (vma_area_is(vma, VMA_ANON_SHARED))
return false;

15
mem.c
View File

@ -67,8 +67,23 @@ unsigned int dump_pages_args_size(struct vm_area_list *vmas)
static inline bool should_dump_page(VmaEntry *vmae, u64 pme)
{
#ifdef CONFIG_VDSO
/*
* vDSO area must be always dumped because on restore
* we might need to generate a proxy.
*/
if (vma_entry_is(vmae, VMA_AREA_VDSO))
return true;
/*
* In turn VVAR area is special and referenced from
* vDSO area by IP addressing (at least on x86) thus
* never ever dump its content but always use one provided
* by the kernel on restore, ie runtime VVAR area must
* be remapped into proper place..
*/
if (vma_entry_is(vmae, VMA_AREA_VVAR))
return false;
#endif
/*
* Optimisation for private mapping pages, that haven't
* yet being COW-ed