diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h index bf33946b5..53b3df804 100644 --- a/arch/x86/include/asm/types.h +++ b/arch/x86/include/asm/types.h @@ -245,4 +245,6 @@ typedef struct { # define MADV_DONTDUMP 16 #endif +#define TASK_SIZE ((1UL << 47) - 1) + #endif /* __CR_ASM_TYPES_H__ */ diff --git a/parasite-syscall.c b/parasite-syscall.c index 26de3ad54..49b47aa63 100644 --- a/parasite-syscall.c +++ b/parasite-syscall.c @@ -591,6 +591,9 @@ int parasite_dump_pages_seized(struct parasite_ctl *ctl, struct list_head *vma_a continue; } + if (vma_area->vma.end > TASK_SIZE) + continue; + ret = parasite_execute(PARASITE_CMD_DUMPPAGES, ctl); if (ret) { pr_err("Dumping pages failed with %d\n", ret); diff --git a/pie/restorer.c b/pie/restorer.c index 337577a33..5769603fd 100644 --- a/pie/restorer.c +++ b/pie/restorer.c @@ -466,6 +466,9 @@ long __export_restore_task(struct task_restore_core_args *args) } } + if (vma_entry->end >= TASK_SIZE) + continue; + if (vma_entry->end > premmapped_end) { if (vma_entry->start < premmapped_end) addr = premmapped_end; @@ -488,6 +491,9 @@ long __export_restore_task(struct task_restore_core_args *args) if (!vma_priv(vma_entry)) continue; + if (vma_entry->end >= TASK_SIZE) + continue; + if (vma_entry->start > vma_entry->shmid) break; @@ -505,6 +511,9 @@ long __export_restore_task(struct task_restore_core_args *args) if (!vma_priv(vma_entry)) continue; + if (vma_entry->start > TASK_SIZE) + continue; + if (vma_entry->start < vma_entry->shmid) break;