* [PATCH] checkpoint: handle sigaltstack
@ 2010-07-14 15:23 Nathan Lynch
[not found] ` <1279121025-17795-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Lynch @ 2010-07-14 15:23 UTC (permalink / raw)
To: orenl-eQaUEPhvms7ENvBUuze7eA
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA
sigaltstack(2) manipulates two fields in task_struct; save and restore
these. Without this change the alternate stack is not used after
restart.
Signed-off-by: Nathan Lynch <ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
---
include/linux/checkpoint_hdr.h | 2 ++
kernel/checkpoint/process.c | 6 ++++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/linux/checkpoint_hdr.h b/include/linux/checkpoint_hdr.h
index c8383c0..bc4ef43 100644
--- a/include/linux/checkpoint_hdr.h
+++ b/include/linux/checkpoint_hdr.h
@@ -380,6 +380,8 @@ struct ckpt_hdr_task {
__u64 set_child_tid;
__u64 clear_child_tid;
+ __u64 sas_ss_sp;
+ __u32 sas_ss_size;
} __attribute__((aligned(8)));
/* Posix capabilities */
diff --git a/kernel/checkpoint/process.c b/kernel/checkpoint/process.c
index f6f3771..936675a 100644
--- a/kernel/checkpoint/process.c
+++ b/kernel/checkpoint/process.c
@@ -138,6 +138,9 @@ static int checkpoint_task_struct(struct ckpt_ctx *ctx, struct task_struct *t)
h->exit_state = t->exit_state;
h->exit_code = t->exit_code;
+ h->sas_ss_sp = t->sas_ss_sp;
+ h->sas_ss_size = t->sas_ss_size;
+
if (t->exit_state) {
/* zombie - skip remaining state */
BUG_ON(t->exit_state != EXIT_ZOMBIE);
@@ -542,6 +545,9 @@ static int restore_task_struct(struct ckpt_ctx *ctx)
t->exit_signal = h->exit_signal;
t->pdeath_signal = h->pdeath_signal;
+ t->sas_ss_sp = (unsigned long)h->sas_ss_sp;
+ t->sas_ss_size = h->sas_ss_size;
+
t->set_child_tid =
(int __user *) (unsigned long) h->set_child_tid;
t->clear_child_tid =
--
1.7.1.1
^ permalink raw reply related [flat|nested] 3+ messages in thread[parent not found: <1279121025-17795-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] checkpoint: handle sigaltstack [not found] ` <1279121025-17795-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org> @ 2010-07-14 16:44 ` Dan Smith 2010-07-20 2:29 ` Oren Laadan 1 sibling, 0 replies; 3+ messages in thread From: Dan Smith @ 2010-07-14 16:44 UTC (permalink / raw) To: Nathan Lynch; +Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA NL> sigaltstack(2) manipulates two fields in task_struct; save and NL> restore these. Without this change the alternate stack is not NL> used after restart. This makes all my sigaltstack-related tests work. Thanks! Tested-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org> -- Dan Smith IBM Linux Technology Center email: danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] checkpoint: handle sigaltstack [not found] ` <1279121025-17795-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org> 2010-07-14 16:44 ` Dan Smith @ 2010-07-20 2:29 ` Oren Laadan 1 sibling, 0 replies; 3+ messages in thread From: Oren Laadan @ 2010-07-20 2:29 UTC (permalink / raw) To: Nathan Lynch; +Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA Acked, and pulled to v22-dev, thanks. Oren. On 07/14/2010 11:23 AM, Nathan Lynch wrote: > sigaltstack(2) manipulates two fields in task_struct; save and restore > these. Without this change the alternate stack is not used after > restart. > > Signed-off-by: Nathan Lynch <ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org> > --- > include/linux/checkpoint_hdr.h | 2 ++ > kernel/checkpoint/process.c | 6 ++++++ > 2 files changed, 8 insertions(+), 0 deletions(-) > > diff --git a/include/linux/checkpoint_hdr.h b/include/linux/checkpoint_hdr.h > index c8383c0..bc4ef43 100644 > --- a/include/linux/checkpoint_hdr.h > +++ b/include/linux/checkpoint_hdr.h > @@ -380,6 +380,8 @@ struct ckpt_hdr_task { > > __u64 set_child_tid; > __u64 clear_child_tid; > + __u64 sas_ss_sp; > + __u32 sas_ss_size; > } __attribute__((aligned(8))); > > /* Posix capabilities */ > diff --git a/kernel/checkpoint/process.c b/kernel/checkpoint/process.c > index f6f3771..936675a 100644 > --- a/kernel/checkpoint/process.c > +++ b/kernel/checkpoint/process.c > @@ -138,6 +138,9 @@ static int checkpoint_task_struct(struct ckpt_ctx *ctx, struct task_struct *t) > h->exit_state = t->exit_state; > h->exit_code = t->exit_code; > > + h->sas_ss_sp = t->sas_ss_sp; > + h->sas_ss_size = t->sas_ss_size; > + > if (t->exit_state) { > /* zombie - skip remaining state */ > BUG_ON(t->exit_state != EXIT_ZOMBIE); > @@ -542,6 +545,9 @@ static int restore_task_struct(struct ckpt_ctx *ctx) > t->exit_signal = h->exit_signal; > t->pdeath_signal = h->pdeath_signal; > > + t->sas_ss_sp = (unsigned long)h->sas_ss_sp; > + t->sas_ss_size = h->sas_ss_size; > + > t->set_child_tid = > (int __user *) (unsigned long) h->set_child_tid; > t->clear_child_tid = ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-20 2:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-14 15:23 [PATCH] checkpoint: handle sigaltstack Nathan Lynch
[not found] ` <1279121025-17795-1-git-send-email-ntl-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2010-07-14 16:44 ` Dan Smith
2010-07-20 2:29 ` Oren Laadan
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.