[CRIU] [PATCH] parasite: add a comment why we can safly trap task on sigreturn

Andrey Vagin avagin at openvz.org
Fri Sep 27 10:36:15 PDT 2013


The kernel notifies about leaving syscall before starting to deliver
signals. If you don't believe me, pls look at arch/x86/kernel/entry_64.S:

int_ret_from_sys_call
        syscall_trace_leave
        do_notify_resume

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 parasite-syscall.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/parasite-syscall.c b/parasite-syscall.c
index 2ef0b60..4c2e7c7 100644
--- a/parasite-syscall.c
+++ b/parasite-syscall.c
@@ -759,6 +759,12 @@ static int parasite_fini_seized(struct parasite_ctl *ctl)
 	if (parasite_stop_on_syscall(1, __NR_rt_sigreturn))
 		return -1;
 
+	/*
+	 * All signals are unblocked now. The kernel notifies about leaving
+	 * syscall before starting to deliver signals. All parasite code are
+	 * executed with blocked signals, so we can sefly unmap a parasite blob.
+	 */
+
 	return 0;
 }
 
-- 
1.8.3.1



More information about the CRIU mailing list