[CRIU] [PATCH 4/4] restore: Restore blocked signals mask in threads

Cyrill Gorcunov gorcunov at openvz.org
Tue Oct 30 17:57:39 EDT 2012


Reported-by: Pavel Emelyanov <xemul at parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c       |    2 ++
 include/restorer.h |    3 +++
 restorer.c         |    3 +++
 3 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index d47e34f..16d9cd5 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -1545,6 +1545,8 @@ static int sigreturn_restore(pid_t pid, CoreEntry *core, struct list_head *tgt_v
 			thread_args[i].has_futex	= true;
 			thread_args[i].futex_rla	= core->thread_core->futex_rla;
 			thread_args[i].futex_rla_len	= core->thread_core->futex_rla_len;
+			thread_args[i].has_blk_sigset	= core->thread_core->has_blk_sigset;
+			thread_args[i].blk_sigset	= core->thread_core->blk_sigset;
 
 			ret = prep_sched_info(&thread_args[i].sp, core->thread_core);
 			if (ret)
diff --git a/include/restorer.h b/include/restorer.h
index 11750e4..e71a32b 100644
--- a/include/restorer.h
+++ b/include/restorer.h
@@ -72,6 +72,9 @@ struct thread_restore_args {
 	UserX86RegsEntry		gpregs;
 	u64				clear_tid_addr;
 
+	bool				has_blk_sigset;
+	u64				blk_sigset;
+
 	bool				has_futex;
 	u64				futex_rla;
 	u32				futex_rla_len;
diff --git a/restorer.c b/restorer.c
index 369adb9..c66ca56 100644
--- a/restorer.c
+++ b/restorer.c
@@ -199,6 +199,9 @@ static int restore_thread_common(struct rt_sigframe *sigframe,
 		}
 	}
 
+	if (args->has_blk_sigset)
+		sigframe->uc.uc_sigmask.sig[0] = args->blk_sigset;
+
 	restore_sched_info(&args->sp);
 
 	return restore_gpregs(sigframe, &args->gpregs);
-- 
1.7.7.6



More information about the CRIU mailing list