• Cyrill Gorcunov's avatar
    restore: Don't unmap vdso proxy on final cleanup · 0707df77
    Cyrill Gorcunov authored
    In case if we need to use vdso proxy the memory area
    which holds restorer also has a place for vdso proxy
    code itself, so on final pass we should not unmap it,
    otherwise any call to vdso function will cause sigsegv.
    
    IOW, the memory before final "cleanup" pass of restorer
    might look as
    
        +-----------+---------+     +-------------+------+
        | bootstrap | rt-vdso | ... | application | vdso |
        +-----------+---------+     +-------------+------+
                           ^                         |
                           `-------------------------+
    
    and we have redirected "vdso" code to jump to "rt-vdso".
    After final pass the memory must look as
    
                    +---------+     +-------------+------+
                    | rt-vdso | ... | application | vdso |
                    +---------+     +-------------+------+
                           ^                         |
                           `-------------------------+
    
    I noticed this problem during container migration
    testing, the container itself was suspended on 2.6.32
    OpenVZ kernel with apache running inside, and any attempt
    to connect to apache caused apache to crash.
    Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    0707df77
cr-restore.c 55.7 KB