mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
Don't overwrite sigaction magic
Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Cyrill Gorcunov
parent
9a544596fe
commit
baf69d6757
@@ -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;
|
||||
|
Reference in New Issue
Block a user