[CRIU] BUG in parasite_infect_seized()

Dmitry Safonov dsafonov at virtuozzo.com
Fri May 20 09:46:21 PDT 2016


On 05/20/2016 06:55 PM, Kirill Tkhai wrote:
>
> On 20.05.2016 18:03, Dmitry Safonov wrote:
>> On 05/20/2016 05:45 PM, Kirill Tkhai wrote:
>>
>>> On 20.05.2016 17:40, Dmitry Safonov wrote:
>>>> On 05/20/2016 03:39 PM, Kirill Tkhai wrote:
>>>>> Hi,
>>>>>
>>>>> in case of parasite_start_daemon() fail, there is called:
>>>>>
>>>>> parasite_cure_seized()->parasite_cure_remote()->parasite_unmap()->parasite_run() and parasite_stop_on_syscall(),
>>>>>
>>>>> but the tracee is not infected at the moment, and it can't execute remote commands.
>>>>>
>>>>> So, criu fails to unmap memfd.
>>>>
>>>> That may be fixed by adding else to parasite_stop_daemon:
>>>>>    if (ctl->daemonized) {
>>>> ...
>>>>>    } else {
>>>>>        return -1;
>>>>>    }
>>>>
>>>> Which is also logical: parasite_stop_daemon returns error
>>>> if control was not daemonized.
>>>
>>> But this case mapped memory still present in a tracee, doesn't it?
>>
>>
>> Well, you're right, I missed that.
>> It looks like we need then move unmap from daemon commands
>> to raw unmap syscall with setting ctl registers.
>> I may do this on evening if there wouldn't be any patches yet :)
>
> Cyrill said, there were a discussion, why the unmap in case of success
> should be done by tracee. Thus, raw unmap should be done in case of failure
> only.
>
> Maybe, someone remembers?
>

It seems like it was done by commit a1809b205eeb ("parasite: Generalize
running parasite context").


More information about the CRIU mailing list