[CRIU] [PATCHv3 16/30] parasite: convert sigframe to u64

Dmitry Safonov dsafonov at virtuozzo.com
Tue Jun 28 12:24:09 PDT 2016


Sigframe pointer should be fixed size.
Convert members of rt_sigframe_ia32 to fixed-size.
After this patch dumping of compatible tasks works.

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 criu/arch/x86/include/asm/fpu.h      |  4 ++--
 criu/arch/x86/include/asm/restorer.h |  2 +-
 criu/include/parasite.h              | 10 +++++-----
 criu/parasite-syscall.c              |  2 +-
 criu/pie/parasite.c                  |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/criu/arch/x86/include/asm/fpu.h b/criu/arch/x86/include/asm/fpu.h
index be168324bc96..6362ebe47f79 100644
--- a/criu/arch/x86/include/asm/fpu.h
+++ b/criu/arch/x86/include/asm/fpu.h
@@ -93,10 +93,10 @@ typedef struct {
 
 	union {
 		struct xsave_struct	xsave;
-		unsigned char		__pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
+		u8		__pad[sizeof(struct xsave_struct) + FP_XSTATE_MAGIC2_SIZE];
 	};
 
-	bool has_fpu;
+	u8 has_fpu;
 } fpu_state_t;
 
 #endif /* __CR_ASM_FPU_H__ */
diff --git a/criu/arch/x86/include/asm/restorer.h b/criu/arch/x86/include/asm/restorer.h
index 66931e1d46fc..a93f3010dd55 100644
--- a/criu/arch/x86/include/asm/restorer.h
+++ b/criu/arch/x86/include/asm/restorer.h
@@ -116,7 +116,7 @@ struct ucontext_ia32 {
 
 struct rt_sigframe_ia32 {
 	u32			pretcode;
-	int			sig;
+	s32			sig;
 	u32			pinfo;
 	u32			puc;
 #ifdef CONFIG_X86_64
diff --git a/criu/include/parasite.h b/criu/include/parasite.h
index 77688100e58a..82f4c3fb5db7 100644
--- a/criu/include/parasite.h
+++ b/criu/include/parasite.h
@@ -69,14 +69,14 @@ struct ctl_msg {
 	(struct ctl_msg){.cmd = _cmd, .ack = _cmd, .err = _err, }
 
 struct parasite_init_args {
-	s32				h_addr_len;
-	struct sockaddr_un		h_addr;
+	s32			h_addr_len;
+	struct sockaddr_un	h_addr;
 
-	s32				log_level;
+	s32			log_level;
 
-	struct rt_sigframe		*sigframe;
+	u64			sigreturn_addr;
 
-	u64				sigreturn_addr;
+	u64			sigframe; /* pointer to sigframe */
 };
 
 struct parasite_unmap_args {
diff --git a/criu/parasite-syscall.c b/criu/parasite-syscall.c
index e6db4972333b..f658dfd37c33 100644
--- a/criu/parasite-syscall.c
+++ b/criu/parasite-syscall.c
@@ -512,7 +512,7 @@ static int parasite_init_daemon(struct parasite_ctl *ctl, struct ns_id *net)
 
 	args = parasite_args(ctl, struct parasite_init_args);
 
-	args->sigframe = ctl->rsigframe;
+	args->sigframe = (uintptr_t)ctl->rsigframe;
 	args->log_level = log_get_loglevel();
 
 	if (prepare_tsock(ctl, pid, args, net))
diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
index 96ea2c8bcdd7..b0dbafa6cfd5 100644
--- a/criu/pie/parasite.c
+++ b/criu/pie/parasite.c
@@ -735,7 +735,7 @@ static noinline __used int parasite_init_daemon(void *data)
 	int ret;
 
 	args->sigreturn_addr = (u64)(uintptr_t)fini_sigreturn;
-	sigframe = args->sigframe;
+	sigframe = (void*)(uintptr_t)args->sigframe;
 
 	tsock = sys_socket(PF_UNIX, SOCK_SEQPACKET, 0);
 	if (tsock < 0) {
-- 
2.9.0



More information about the CRIU mailing list