[CRIU] multiple open() on a file during restore

Pavel Emelyanov xemul at parallels.com
Fri Jun 26 12:48:37 PDT 2015


On 06/26/2015 09:20 PM, CRIU criu wrote:
> So I'm adding support for Android binder, which assumes that a process will open the 
> device only once. Based on the existing code flow, the device is opened two times 
> during restore.
> 
> I see the following sequence open() -> mmap() -> close() -> open()
> This causes incorrect bookkeeping insider binder driver.

First three are likely from vma restore -- it opens a file to get mapped
into the area. The send one is from fd restore.

This can be fixed by teaching get_filemap_fd() re-use some existing fd
instead of opening a new one.

-- Pavel


More information about the CRIU mailing list