[CRIU] [PATCH 7/8] restore: Add restoration of alternative signal stack

Cyrill Gorcunov gorcunov at gmail.com
Tue Jun 18 06:17:18 EDT 2013


On Tue, Jun 18, 2013 at 04:55:39PM +0400, Andrew Vagin wrote:
> > --- a/pie/restorer.c
> > +++ b/pie/restorer.c
> > @@ -733,6 +733,15 @@ long __export_restore_task(struct task_restore_core_args *args)
> >  		goto core_restore_end;
> >  
> >  	/*
> > +	 * FIXME
> > +	 * Alternative signal stack for the group leader
> > +	 * is setting up separately from the threads.
> > +	 * This better should be unified one day.
> > +	 */
> > +	if (args->has_sas)
> > +		setup_sas(rt_sigframe, &args->sas);
> > +
> 
> I think would be better if setup_sas will be called after restore_signals,
> because before this moment SIGCHLD isn't blocked.
> 
> Can you explain how that works for nested signal handlers?

setup_sas does only one thing -- it prepares sigreturn frame, thus once
sigreturn called the kernel sets up alternative signal frame for the
task, iow simultaneously with setting up new cs:ip. So I don't get how
it's related to nested signal handlers. If I understand you correctly
the SIGCHLD which might be called there is handled by our code with our
own signal handler, no? In turn former blocked signals mask is restored
sigreturn too, thus (if only I've not missed something obvious) -- we're
allowed to restore sas with sigreturn help insted of explicit calling
for sigaltstack() system routine.


More information about the CRIU mailing list