mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-02 07:15:31 +00:00
ia32/restorer: move 32-bit pie unmap to x86
We need compat realization for restorer unmap as after rt_sigreturn() the task is stopped it 32-bit code and ptrace API doesn't allow setting x86_64 full registers set to ia32 task. Generic restorer has now x86-specific __export_unmap_compat() function, which isn't right. Clean restorer from x86-related realization. Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
dd3f23e28d
commit
8544895a52
12
criu/arch/x86/restorer_unmap.S
Normal file
12
criu/arch/x86/restorer_unmap.S
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
#include "common/asm/linkage.h"
|
||||||
|
#include "compel/plugins/std/syscall-codes.h"
|
||||||
|
|
||||||
|
.text
|
||||||
|
ENTRY(__export_unmap_compat)
|
||||||
|
.code32
|
||||||
|
mov bootstrap_start, %ebx
|
||||||
|
mov bootstrap_len, %ecx
|
||||||
|
movl $__NR32_munmap, %eax
|
||||||
|
int $0x80
|
||||||
|
int $0x03 /* Guard */
|
||||||
|
.code64
|
@@ -25,6 +25,7 @@ restorer-obj-y += ./$(ARCH_DIR)/restorer.o
|
|||||||
ifeq ($(ARCH),x86)
|
ifeq ($(ARCH),x86)
|
||||||
ifeq ($(CONFIG_COMPAT),y)
|
ifeq ($(CONFIG_COMPAT),y)
|
||||||
restorer-obj-y += ./$(ARCH_DIR)/call32.o
|
restorer-obj-y += ./$(ARCH_DIR)/call32.o
|
||||||
|
restorer-obj-y += ./$(ARCH_DIR)/restorer_unmap.o
|
||||||
restorer-obj-y += ./$(ARCH_DIR)/sigaction_compat_pie.o
|
restorer-obj-y += ./$(ARCH_DIR)/sigaction_compat_pie.o
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@@ -929,35 +929,14 @@ static unsigned long vdso_rt_size;
|
|||||||
#define vdso_rt_size (0)
|
#define vdso_rt_size (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void *bootstrap_start;
|
void *bootstrap_start = NULL;
|
||||||
static unsigned int bootstrap_len;
|
unsigned int bootstrap_len = 0;
|
||||||
|
|
||||||
void __export_unmap(void)
|
void __export_unmap(void)
|
||||||
{
|
{
|
||||||
sys_munmap(bootstrap_start, bootstrap_len - vdso_rt_size);
|
sys_munmap(bootstrap_start, bootstrap_len - vdso_rt_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_X86_64
|
|
||||||
asm (
|
|
||||||
" .pushsection .text\n"
|
|
||||||
" .global __export_unmap_compat\n"
|
|
||||||
"__export_unmap_compat:\n"
|
|
||||||
" .code32\n"
|
|
||||||
" mov bootstrap_start, %ebx\n"
|
|
||||||
" mov bootstrap_len, %ecx\n"
|
|
||||||
" sub vdso_rt_size, %ecx\n"
|
|
||||||
" movl $"__stringify(__NR32_munmap)", %eax\n"
|
|
||||||
" int $0x80\n"
|
|
||||||
" .code64\n"
|
|
||||||
" .popsection\n"
|
|
||||||
);
|
|
||||||
extern char __export_unmap_compat;
|
|
||||||
#else
|
|
||||||
void __export_unmap_compat(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function unmaps all VMAs, which don't belong to
|
* This function unmaps all VMAs, which don't belong to
|
||||||
* the restored process or the restorer.
|
* the restored process or the restorer.
|
||||||
|
Reference in New Issue
Block a user