diff --git a/criu/arch/aarch64/infect.c b/criu/arch/aarch64/infect.c index 3a9cb10cd..aeb734781 100644 --- a/criu/arch/aarch64/infect.c +++ b/criu/arch/aarch64/infect.c @@ -6,7 +6,6 @@ #include #include "asm/types.h" #include "criu-log.h" -#include "kerndat.h" #include "parasite-syscall.h" #include "compel/include/errno.h" #include "infect.h" diff --git a/criu/arch/arm/infect.c b/criu/arch/arm/infect.c index 6fe6142be..b22e98d9c 100644 --- a/criu/arch/arm/infect.c +++ b/criu/arch/arm/infect.c @@ -5,7 +5,6 @@ #include #include "asm/types.h" #include "criu-log.h" -#include "kerndat.h" #include "parasite-syscall.h" #include "compel/include/errno.h" #include "infect.h" @@ -100,7 +99,7 @@ void *remote_mmap(struct parasite_ctl *ctl, err = compel_syscall(ctl, __NR_mmap2, &map, (unsigned long)addr, length, prot, flags, fd, offset >> 12); - if (err < 0 || map > kdat.task_size) + if (err < 0 || map > ctl->ictx.task_size) map = 0; return (void *)map; diff --git a/criu/include/infect.h b/criu/include/infect.h index c0f31d16b..fc4f949f9 100644 --- a/criu/include/infect.h +++ b/criu/include/infect.h @@ -102,6 +102,7 @@ struct infect_ctx { int (*make_sigframe)(void *, struct rt_sigframe *, struct rt_sigframe *, k_rtsigset_t *); void *regs_arg; + unsigned long task_size; unsigned long syscall_ip; /* entry point of infection */ unsigned long flags; /* fine-tune (e.g. faults) */ diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c index 0d7355362..59d067351 100644 --- a/criu/parasite-syscall.c +++ b/criu/parasite-syscall.c @@ -549,6 +549,7 @@ struct parasite_ctl *parasite_infect_seized(pid_t pid, struct pstree_item *item, ictx->save_regs = save_task_regs; ictx->make_sigframe = make_sigframe; ictx->regs_arg = item->core[0]; + ictx->task_size = kdat.task_size; ictx->syscall_ip = p; pr_debug("Parasite syscall_ip at %#lx\n", p);