• Andrey Vagin's avatar
    restorer: Block signals early · 5d18eca3
    Andrey Vagin authored
    Otherwise threads can handle them before calling sigreturn with wrong (not
    belonging to crtools, but to the target task) handers:
    
    __export_restore_task				| __export_restore_thread
    
    restore_finish_stage(CR_STATE_RESTORE);		| restore_finish_stage(CR_STATE_RESTORE);
    sys_sigaction(SIGCHLD, &args->sigchld_act, ...) |
    restore_signals()				|
    	ksigfillset(&to_block);			|
    	sys_rt_sigqueueinfo(sys_getpid(), ...); |
    						| execute signal handler() <------ BUG !!!
    						| restore_signals()
    						|	ksigfillset(&to_block);
    Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    5d18eca3
restorer.c 24.5 KB