Commit 566a900e authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

restore: Use prctl for vDSO restoration

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@gmail.com>
parent a4d37dcf
...@@ -38,6 +38,21 @@ ...@@ -38,6 +38,21 @@
#define PTRACE_O_TRACEVFORKDONE 0x00000020 #define PTRACE_O_TRACEVFORKDONE 0x00000020
#define PTRACE_O_TRACEEXIT 0x00000040 #define PTRACE_O_TRACEEXIT 0x00000040
/* prctl.h */
#define PR_SET_NAME 15
#define PR_GET_NAME 16
#define PR_CKPT_CTL 35
# define PR_CKPT_CTL_SETUP_VDSO_AT 1
# define PR_CKPT_CTL_SET_TASK_FLAGS 2
# define PR_CKPT_CTL_SET_MM_START_CODE 3
# define PR_CKPT_CTL_SET_MM_END_CODE 4
# define PR_CKPT_CTL_SET_MM_START_DATA 5
# define PR_CKPT_CTL_SET_MM_END_DATA 6
# define PR_CKPT_CTL_SET_MM_START_STACK 7
# define PR_CKPT_CTL_SET_MM_START_BRK 8
# define PR_CKPT_CTL_SET_MM_BRK 9
/* fcntl */ /* fcntl */
#ifndef F_LINUX_SPECIFIC_BASE #ifndef F_LINUX_SPECIFIC_BASE
#define F_LINUX_SPECIFIC_BASE 1024 #define F_LINUX_SPECIFIC_BASE 1024
......
...@@ -214,6 +214,17 @@ self_len_end: ...@@ -214,6 +214,17 @@ self_len_end:
if (!vma_entry.start) if (!vma_entry.start)
break; break;
if (vma_entry.status & VMA_AREA_VDSO) {
ret = sys_prctl(PR_CKPT_CTL, PR_CKPT_CTL_SETUP_VDSO_AT,
vma_entry.start, 0, 0);
if (ret) {
write_hex_n(__LINE__);
write_hex_n(ret);
goto core_restore_end;
}
continue;
}
if (!(vma_entry.status & VMA_AREA_REGULAR)) if (!(vma_entry.status & VMA_AREA_REGULAR))
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment