Commit baf69d67 authored by Andrey Vagin's avatar Andrey Vagin Committed by Cyrill Gorcunov

Don't overwrite sigaction magic

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9a544596
......@@ -1051,6 +1051,7 @@ static int open_pipe(int pid, struct pipe_entry *e, int *pipes_fd)
static int prepare_sigactions(int pid)
{
u32 type = 0;
int fd_sigact, ret;
int sig, i;
struct sigaction act, oact;
......@@ -1061,6 +1062,12 @@ static int prepare_sigactions(int pid)
return 1;
}
ret = read(fd_sigact, &type, sizeof(type));
if (ret != sizeof(type) || type != SIGACT_MAGIC) {
pr_perror("%d: Bad sigactions file\n", pid);
return 1;
}
for (sig = 1; sig < SIGMAX; sig++) {
if (sig == SIGKILL || sig == SIGSTOP)
continue;
......
......@@ -239,6 +239,8 @@ static int dump_sigact(parasite_args_cmd_dumpsigacts_t *args)
return ret;
}
sys_lseek(fd, MAGIC_OFFSET, SEEK_SET);
for (sig = 1; sig < SIGMAX; sig++) {
if (sig == SIGKILL || sig == SIGSTOP)
continue;
......
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