2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +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:
Artem Trushkin 2024-03-24 17:16:58 +07:00 committed by Andrei Vagin
parent a2b018a188
commit 8f0e200e66

View File

@ -1057,7 +1057,7 @@ static int premap_priv_vmas(struct pstree_item *t, struct vm_area_list *vmas, vo
do {
if (pr->pe->vaddr + pr->pe->nr_pages * PAGE_SIZE <= vma->e->start)
continue;
if (pr->pe->vaddr > vma->e->end)
if (pr->pe->vaddr >= vma->e->end)
vma->e->status |= VMA_NO_PROT_WRITE;
break;
} while (pr->advance(pr));