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

Pavel Emelyanov xemul at parallels.com
Mon Sep 30 07:46:55 PDT 2013


On 09/27/2013 06:36 PM, Andrey Vagin wrote:
> 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;
>  }
>  
> 
applied



More information about the CRIU mailing list