• Dmitry Safonov's avatar
    parasite: align parasite args with 4 bytes · f1d7964e
    Dmitry Safonov authored
    >From the commit 64e74fab ("parasite: handle errors while a transport
    socket is being created"), we have futex in parasite init args to
    synchronize parasite and criu during initialization.
    And man futex(2): "On all platforms, futexes are four-byte integers that
    must be aligned on a four-byte boundary."
    This is checked by kernel in get_futex_key():
    	if (unlikely((address % sizeof(u32)) != 0))
    		return -EINVAL;
    
    So, we need to align parasite arguments on four bytes, while mapping
    of parasite blob on page-aligned address will guarantee that it'll
    be aligned on four bytes in memory.
    
    Fixes:
    (00.013468) -----------------------
    (00.013470) Putting tsock into pid 22043
    (00.014024) Error (criu/parasite-syscall.c:541): futex() returned an unexpected error: -22
    (00.014026) Error (criu/parasite-syscall.c:541): BUG at criu/parasite-syscall.c:541
    
    Cc: Andrew Vagin <avagin@virtuozzo.com>
    Cc: Cyrill Gorcunov <gorcunov@openvz.org>
    Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
    Acked-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    f1d7964e
pie-reloc.lds.S.in 372 Bytes