[CRIU] [PATCH] check: Make sure dirty tracking not used on unpatched kernel

Pavel Emelyanov xemul at parallels.com
Thu Jan 30 10:17:38 PST 2014


On 01/30/2014 10:08 PM, Cyrill Gorcunov wrote:
> On Thu, Jan 30, 2014 at 09:57:06PM +0400, Pavel Emelyanov wrote:
>> On 01/30/2014 09:40 PM, Cyrill Gorcunov wrote:
>>> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
>>> ---
>>>  kerndat.c | 12 ++++++++++++
>>>  1 file changed, 12 insertions(+)
>>>
>>> diff --git a/kerndat.c b/kerndat.c
>>> index 27acf0cc2ed1..04c937f1814f 100644
>>> --- a/kerndat.c
>>> +++ b/kerndat.c
>>> @@ -88,6 +88,18 @@ int kerndat_get_dirty_track(void)
>>>  
>>>  	map[0] = '\0';
>>>  
>>> +	/*
>>> +	 * It's known some kernel versions may have a dirty
>>> +	 * page tracking bug which clears soft dirty bit if
>>> +	 * mprotect code is unpatched. So in such case don't
>>> +	 * allow to use dirty page tracking.
>>> +	 */
>>> +	if (mprotect(map, PAGE_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC)) {
>>
>> O_o Why mprotect failure results in disabled tracker? And how does it
>> correlate with soft-dirty BUG()?
>> Anyway -- I'm not applying the patch, since the fix is going to be in
>> stables soon.
> 
> If mprotect failed it means we can't test for bug, this also means
> we can't be sure if traking is consistent, better to refuse traking
> than endup with incomplete data on restore. Are we sure all users
> to run criu with stable kernel updated?

No. But as we don't have stable kernel yet, this means we have no way
to use tracker.


More information about the CRIU mailing list