mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 13:28:27 +00:00
mem: fix some VMAs being incorrectly mapped wtih PROT_WRITE
A memory interval is a half-open interval, so the condition when pr->pe->vaddr == vma->e->end should not be interpreted as an intersection and should cause vma to be marked with VMA_NO_PROT_WRITE. Fixes: #2364 Signed-off-by: Artem Trushkin <at.120@ya.ru>
This commit is contained in:
parent
a2b018a188
commit
8f0e200e66
@ -1057,7 +1057,7 @@ static int premap_priv_vmas(struct pstree_item *t, struct vm_area_list *vmas, vo
|
|||||||
do {
|
do {
|
||||||
if (pr->pe->vaddr + pr->pe->nr_pages * PAGE_SIZE <= vma->e->start)
|
if (pr->pe->vaddr + pr->pe->nr_pages * PAGE_SIZE <= vma->e->start)
|
||||||
continue;
|
continue;
|
||||||
if (pr->pe->vaddr > vma->e->end)
|
if (pr->pe->vaddr >= vma->e->end)
|
||||||
vma->e->status |= VMA_NO_PROT_WRITE;
|
vma->e->status |= VMA_NO_PROT_WRITE;
|
||||||
break;
|
break;
|
||||||
} while (pr->advance(pr));
|
} while (pr->advance(pr));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user