Commit 315b7981 authored by Andrey Vagin's avatar Andrey Vagin Committed by Cyrill Gorcunov

Block all signals before sigreturn

sigactions are restored before memory and if a parent get a signal
which has a handler, it will get segmentation fault.

This problem will disappear, when we add a freezer, because
all processes will be resumed after restoring.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent cbb6b2da
...@@ -1207,6 +1207,16 @@ static int restore_task_with_children(int my_pid, char *pstree_path) ...@@ -1207,6 +1207,16 @@ static int restore_task_with_children(int my_pid, char *pstree_path)
int *pids; int *pids;
int fd, ret, i; int fd, ret, i;
struct pstree_entry e; struct pstree_entry e;
sigset_t blockmask;
/* The block mask will be restored in sigresturn
* This code should be removed, when a freezer will be added */
sigfillset(&blockmask);
ret = sigprocmask(SIG_BLOCK, &blockmask, NULL);
if (ret) {
pr_perror("%d: Can't block signals\n", my_pid);
exit(1);
}
pr_info("%d: Starting restore\n", my_pid); pr_info("%d: Starting restore\n", my_pid);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment