[CRIU] [PATCH 9/9] vdso/ia32: Don't unmap rt-vdso

Dmitry Safonov dsafonov at virtuozzo.com
Thu Jun 22 14:04:32 MSK 2017


Found with fault-injected jump trampolines in vdso,
that on ia32 tests rt-vdso got unmapped.
I've fixed it previously, but have forgot it during
moving 32-bit pie's unmap into arch/x86/

Fixes: commit 8544895a528b ("ia32/restorer: move 32-bit pie unmap to x86")
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/arch/x86/restorer_unmap.S | 1 +
 criu/pie/restorer.c            | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/criu/arch/x86/restorer_unmap.S b/criu/arch/x86/restorer_unmap.S
index 09c4c9583da3..d721eaf97d96 100644
--- a/criu/arch/x86/restorer_unmap.S
+++ b/criu/arch/x86/restorer_unmap.S
@@ -6,6 +6,7 @@ ENTRY(__export_unmap_compat)
 	.code32
 	mov	bootstrap_start, %ebx
 	mov	bootstrap_len, %ecx
+	sub	vdso_rt_size, %ecx
 	movl	$__NR32_munmap, %eax
 	int	$0x80
 	int	$0x03 /* Guard */
diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
index 8003763c496e..a1130ce189eb 100644
--- a/criu/pie/restorer.c
+++ b/criu/pie/restorer.c
@@ -1040,7 +1040,7 @@ static void restore_posix_timers(struct task_restore_args *args)
  * trap us on the exit from sys_munmap.
  */
 #ifdef CONFIG_VDSO
-static unsigned long vdso_rt_size;
+unsigned long vdso_rt_size = 0;
 #else
 #define vdso_rt_size	(0)
 #endif
-- 
2.13.1



More information about the CRIU mailing list