[CRIU] Preserve the "dumpable" flag on criu dump/restore.

Andrew Vagin avagin at parallels.com
Tue May 13 03:38:06 PDT 2014


On Mon, May 12, 2014 at 03:37:06PM -0700, Filipe Brandenburger wrote:
> Hi,
> 
> Sorry for the double report, but I didn't know whether Bugzilla or
> mailing list was more appropriate...
> 
> I found this issue with the files in /proc/$pid being owned by
> root:root after a criu restore. I traced it to the fact that the
> "dumpable" flag for the task does not get preserved over a criu
> dump/restore.
> 
> I filed this bug about it:
> https://bugzilla.openvz.org/show_bug.cgi?id=2968
> 
> And I sent this patch which fixes the issue:
> http://2968.bugzilla.openvz.org/attachment.cgi?id=2147
> 
> While testing the patch with zdtm, I also found that it caused
> static/cow01 to break. After some investigation, I got to the
> conclusion that cow01 was inherently broken and without the "dumpable"
> flag being preserved it would always succeed even though it was not
> really checking whether pages are COWed...
> 
> On the other hand, after the fix to preserve the "dumpable" flag, then
> test static/cow01 was failing consistently. It turns out that it seems
> that COW is not really working as expected, and now that the test was
> fixed it's showing that this is actually broken.

cow01 started fails after my commit :(. Thank you for the report. Good catch.

7659c995f58faeeca6ecfec2e22e361198541e4b is the first bad commit
commit 7659c995f58faeeca6ecfec2e22e361198541e4b
Author: Andrey Vagin <avagin at openvz.org>
Date:   Fri Nov 22 18:19:08 2013 +0400

    vm: don't overwrite vma->shmid for private mappings
    
    shmid contains a file id for file mappings. It's required to determine,
    which VMA-s are cowed. The parent maps a VMA and saves premmaped
    address. Then  child trys to determing, which VMA-s must be inhereted
    from parent, for that it compares addresses, flags and file id.
    
    We don't want to transfer vma_area-s in restorer, so when a VMA entry is
    copied in restorer memory, the premmaped address is save in shmid.
    
    Signed-off-by: Andrey Vagin <avagin at openvz.org>
    Signed-off-by: Pavel Emelyanov <xemul at parallels.com>

:100644 100644 7ba42fd3be8d10061e45ca66fdb4999c54770792 1c67a20269f80cfb10c411304e1fa2c75588e8a5 M	cr-restore.c
:040000 040000 40815fcaad1784652d4b5bc212b21f8ebca70401 7c7226aedfeba1db521b20b276928db7eba162ce M	include

> 
> I filed this bug to report the fact that the static/cow01 test seems
> to be broken:
> https://bugzilla.openvz.org/show_bug.cgi?id=2967
> 
> It seems that COW support itself also needs to be fixed. I'm currently
> looking into it but I'm not really sure where the problem is yet.
> 
> Let me know if you have any questions about the dumpable flag patch.
> 
> Thanks!
> Filipe
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list