[CRIU] [PATCH 09/10] restore: Add restoration of alternative signal stack, v2

Pavel Emelyanov xemul at parallels.com
Tue Jul 9 12:19:59 EDT 2013


On 07/04/2013 04:19 PM, Cyrill Gorcunov wrote:
> On Thu, Jul 04, 2013 at 04:16:20PM +0400, Cyrill Gorcunov wrote:
>> On Thu, Jul 04, 2013 at 04:13:58PM +0400, Cyrill Gorcunov wrote:
>>> On Thu, Jul 04, 2013 at 03:55:11PM +0400, Cyrill Gorcunov wrote:
>>>>
>>>> Hmm, has_sas looks more clear for me. But I can update if you prefer.
>>>
>>> Hope this one suite you better.
>>
>> Crap. forgot to update change log, sorry. Will do in a few minutes.
> 
> Final one.
> 

> +#define SAS_INVALID_SP		(-1ull)

This one can be (u64)-casted here to avoid casts where used.

> @@ -31,5 +31,17 @@ int construct_sigframe(struct rt_sigframe *sigframe,
>  	if (restore_gpregs(sigframe, CORE_THREAD_ARCH_INFO(core)->gpregs))
>  		return -1;
>  
> +	/*
> +	 * On restore we have 2 ways for sas
> +	 * - either call for sigaltstack explicitly in restorer.c right before
> +	 *   we call for sigreturn
> +	 *
> +	 * - either pass stack value to sigreturn call and allow the kernel to
> +	 *   restore stack for us
> +	 *
> +	 * Second way looks more clean and simple, and here we go.
> +	 */
> +	setup_sas(sigframe, core->thread_core->sas);

This thing is

a) called w/o checks for sas being valid (SAS_INVALID_SP)
b) called for parasite code

Why is a) and does b) also work?

> +
>  	return 0;
>  }



More information about the CRIU mailing list