From 6b31a75a68a0aeecf6ee1c8a06d0ed8cd38df68f Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Mon, 30 Sep 2013 18:46:50 +0400 Subject: [PATCH] parasite: add a comment why we can safly trap task on sigreturn 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 Signed-off-by: Pavel Emelyanov --- parasite-syscall.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/parasite-syscall.c b/parasite-syscall.c index 40a9167af..03925bc6f 100644 --- a/parasite-syscall.c +++ b/parasite-syscall.c @@ -754,6 +754,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; }