[CRIU] [PATCH 09/10] restore: Add restoration of alternative signal stack, v2
Cyrill Gorcunov
gorcunov at gmail.com
Tue Jul 9 13:15:41 EDT 2013
On Tue, Jul 09, 2013 at 09:11:38PM +0400, Pavel Emelyanov wrote:
> > on init we save dumpee sas in memory, thus if something go wrong we restore
>
> Do we have the sas at hands at that time?
Yes. Look how it works now
- pstree-entry allocated (together with place for sas, but no
real value yet assigned)
- parasite_init called, which forces dumpee to provide back the
sas value it has
-------------------------------- pie/parasite.c --------------------------------
index 4f6708f..30548c5 100644
@@ -230,6 +230,9 @@ static int init_thread(struct parasite_dump_thread *args)
args->tid = tid;
args->tls = arch_get_tls();
+ ret = sys_sigaltstack(NULL, &args->sas);
+ if (ret)
+ goto err;
return ret;
err:
@@ -258,6 +261,10 @@ static int init(struct parasite_init_args *args)
if (ret)
return -1;
+ ret = sys_sigaltstack(NULL, &args->sas);
+ if (ret)
+ goto err;
+
- parasite-syscall.c code encodes these values into protobuf format
and copies them to pstree entry
- parasite-sysall.c code generates restore sigframe and put these
values back to rollback if error happened
More information about the CRIU
mailing list