[CRIU] Re: [PATCH] restorer: close log file before detaching from crtools

Kinsbursky Stanislav skinsbursky at openvz.org
Mon Feb 20 11:21:45 EST 2012


20.02.2012 19:31, Cyrill Gorcunov пишет:
> On Mon, Feb 20, 2012 at 07:12:14PM +0400, Kinsbursky Stanislav wrote:
> ...
>>>> +
>>>> +core_restore_failed:
>>>> +	asm volatile(
>>>> +		"movq %0, %%rsp				\n"
>>>> +		"jmp *%1				\n"
>>>> +		:
>>>> +		: "r"(ret), "r"(line)
>>>> +		: );
>>>> +	return ret;
>>> We have a similar code in BUG_ON_HANDLER, but this code is better, so
>>> I think you can improve BUG_ON_HANDLER and use it.
>> Thanks for your valuable opinion. I'll keep that in mind.
>>
> Since both IP and SP are printed in dmesg I guess we might load
> line number into SP and cause NULL dereference, something like
>
> core_restore_failed:
> 	asm volatile(
> 		"movq %0, %%rsp				\n"
> 		"xorl %%eax, %%eax			\n"
> 		"movl %%eax, (%%eax)			\n"
> 		:
> 		: "r"(line)
> 		: );

This is not as good, as my version is. My version also shows error code.
Could you add it somehow?

> or, as Andrew mentioned, extend BUG_ON_HANDLER. Hm?
>
> 	Cyrill

This BUG_ON_HANDLER relies on log fd is valid. It's not our case.

-- 
Best regards,
Stanislav Kinsbursky




More information about the CRIU mailing list