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

Andrew Vagin avagin at parallels.com
Tue Jun 18 07:15:58 EDT 2013


On Tue, Jun 18, 2013 at 05:56:53PM +0400, Cyrill Gorcunov wrote:
> On Tue, Jun 18, 2013 at 05:43:21PM +0400, Andrew Vagin wrote:
> > > task, iow simultaneously with setting up new cs:ip. So I don't get how
> > > it's related to nested signal handlers.
> > 
> > It was off topic question.
> 
> ok
> 
> > > own signal handler, no?
> > yes. But when I wrote this message I did not know that altstack is used
> > only for SA_ONSTACK, so we can restore sas here.
> 
> ok, thanks!
> 
> > > 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.
> > 
> > So why do we call sigaltstack?
> 
> We call sigaltstack in only one case -- on dump, to fetch the value(s)
> dumpee has. On restore we have 2 ways
> 
>  - either call for sigaltstack explicitly in restorer.c right before
>    we call for sigreturn
You use this way in these patches.
> 
>  - either pass stack value to sigreturn call and allow the kernel to
>    restore stack for us
> 
> I chose second way and simply tune up sigframe. Sounds reasonable?
You are going to implement the second way...

I vote for the second way too.


More information about the CRIU mailing list