[CRIU] [PATCH] restore: open the pidfile with O_EXCL

Pavel Emelyanov xemul at parallels.com
Wed Sep 3 09:58:46 PDT 2014


On 09/02/2014 10:14 PM, Serge Hallyn wrote:
> Quoting Tycho Andersen (tycho.andersen at canonical.com):
>> 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
> 
> (non-root attacker, of course)
> 
>> 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.
> 
> specifically to ensure that root owns the file.
> 
>> We don't need O_TRUNC here since we're O_EXCL-ing the file.
>>
>> Reported-by: Serge Hallyn <serge.hallyn at ubuntu.com>
> 
> Thanks, Tycho.
> 
> Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> 
>> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>

Applied, thanks.



More information about the CRIU mailing list