Skip to content
Commit ae3cb4fb authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov
Browse files

restore: open the pidfile with O_EXCL



There is a potential attack here where if someone is restoring something and
criu write the pid to a file the attacker controls, the attacker can then
re-write that to whatever pid they want. ciru should instead open the file with
O_EXCL so that the restore fails if the file exists.

We don't need O_TRUNC here since we're O_EXCL-ing the file.

Reported-by: default avatarSerge Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: default avatarTycho Andersen <tycho.andersen@canonical.com>
Acked-by: default avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
Signed-off-by: default avatarPavel Emelyanov <xemul@parallels.com>
parent d6f09cd3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment