[PATCH] restore: fix restoring signal blocking mask on arm

Andrey Vagin avagin at openvz.org
Wed Apr 24 11:29:25 EDT 2013


RT_SIGFRAME_UC(sigframe).uc_sigmask.sig = args->blk_sigset;

blk_sigset is u64, but uc_sigmask.sig has type ulong [2], so
only a part of mask is restore here.

This patch reworks restoring of blocking masks symmetrically to dumping
these masks.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 cr-restore.c       | 5 +++--
 include/restorer.h | 2 +-
 pie/restorer.c     | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index f1cb706..a89fbd1 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -2013,7 +2013,8 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
 			thread_args[i].futex_rla	= tcore->thread_core->futex_rla;
 			thread_args[i].futex_rla_len	= tcore->thread_core->futex_rla_len;
 			thread_args[i].has_blk_sigset	= tcore->thread_core->has_blk_sigset;
-			thread_args[i].blk_sigset	= tcore->thread_core->blk_sigset;
+			memcpy(&thread_args[i].blk_sigset,
+				&tcore->thread_core->blk_sigset, sizeof(k_rtsigset_t));
 
 			ret = prep_sched_info(&thread_args[i].sp, tcore->thread_core);
 			if (ret)
@@ -2033,7 +2034,7 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core)
 
 	}
 
-	task_args->t->blk_sigset	= core->tc->blk_sigset;
+	memcpy(&task_args->t->blk_sigset, &core->tc->blk_sigset, sizeof(k_rtsigset_t));
 	task_args->t->has_blk_sigset	= true;
 
 	/*
diff --git a/include/restorer.h b/include/restorer.h
index ef19d64..34bf02c 100644
--- a/include/restorer.h
+++ b/include/restorer.h
@@ -72,7 +72,7 @@ struct thread_restore_args {
 	u32				futex_rla_len;
 
 	bool				has_blk_sigset;
-	u64				blk_sigset;
+	k_rtsigset_t			blk_sigset;
 
 	struct rst_sched_param		sp;
 
diff --git a/pie/restorer.c b/pie/restorer.c
index 4feea0c..8ed94cc 100644
--- a/pie/restorer.c
+++ b/pie/restorer.c
@@ -219,7 +219,7 @@ static int restore_thread_common(struct rt_sigframe *sigframe,
 	}
 
 	if (args->has_blk_sigset)
-		RT_SIGFRAME_UC(sigframe).uc_sigmask.sig[0] = args->blk_sigset;
+		RT_SIGFRAME_UC(sigframe).uc_sigmask = args->blk_sigset;
 
 	restore_sched_info(&args->sp);
 	if (restore_fpu(sigframe, args))
-- 
1.8.2


--CE+1k2dSO48ffgeK--


More information about the CRIU mailing list