[PATCH] checkpoint: handle sigaltstack

Oren Laadan orenl at cs.columbia.edu
Mon Jul 19 19:29:21 PDT 2010


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 at pobox.com>
> ---
>  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 =


More information about the Containers mailing list