mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
cuda: don't leak fds to cuda-checkpoint
Leaking open file descriptors to third-party tools can lead to security risks. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
4dde52a308
commit
fde0b7ac69
3 changed files with 5 additions and 2 deletions
|
|
@ -115,7 +115,9 @@ static int launch_cuda_checkpoint(const char **args, char *buf, int buf_size)
|
|||
if (dup2(fd[WRITE], STDERR_FILENO) == -1) {
|
||||
return -1;
|
||||
}
|
||||
close(fd[READ]);
|
||||
|
||||
close_fds(STDERR_FILENO + 1);
|
||||
|
||||
return execvp(args[0], (char **)args);
|
||||
} else { // parent
|
||||
close(fd[WRITE]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue