1. 29 Sep, 2014 5 commits
    • Pavel Emelyanov's avatar
      fd: Close caches proc-pid stuff before restoring files · 829d4332
      Pavel Emelyanov authored
      We have a bug. If someone opens proc with open_pid_proc or alike
      with PROC_SELF of real PID before going to restore fds, then the
      fd cached by proc helpers would be cached in fd 0 (we close all
      fds beforehead) and it may clash with restored fds.
      
      We don't hit this right now simply due to being too lucky -- we
      call open_proc(PROC_GEN) on "locks" which first closes the cached
      the per-pid descriptor and then reports back just the /proc one
      which sits in service area.
      
      But once we change this (next patch) things would get broken.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      829d4332
    • Pavel Emelyanov's avatar
      proc: Sanitate empty lines · 1c8ab40e
      Pavel Emelyanov authored
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      1c8ab40e
    • Pavel Emelyanov's avatar
      filemap: Get vma mnt_id early · e651a6eb
      Pavel Emelyanov authored
      We have a, well, issue with how we calculate the vma's mnt_id.
      
      Right now get one via criu side file descriptor that it got by
      opening the /proc/pid/map_files/ link. The problem is that these
      descriptors are 'merged' or 'borrowed' by adjacent vmas from
      previous ones. Thus, getting the mnt_id value for each of them
      makes no sense -- these files are the same.
      
      So move this mnt_id getting earlier into vma parsing code. This
      brings a potential problem -- if we have two adjacent vmas
      mapping the same inode (dev:ino pair) but living in different
      mount namespaces -- this check would produce wrong result.
      "Wrong" from the perspective that on restore correct file would
      be opened from wrong namespace.
      
      I propose to live with it, since this is not worse than the
      --evasive-devices option, it's _very_ unlikely, but saves a lot
      of openeings.
      
      Note, that in case app switched mount namespace and then mapped
      some new library (with dlopen) things would work correctly -- new
      vmas will likely be not adjacent and for different dev:ino.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      e651a6eb
    • Pavel Emelyanov's avatar
      vma: Add comments about some dump fields of vma_area · f84d19e0
      Pavel Emelyanov authored
      We have non-obvious handling of vm_file_fd/vm_socket_id
      pair and the vma->file_borrowed.
      
      Comment these to in the structure.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      f84d19e0
    • Pavel Emelyanov's avatar
      vma: Reshuffle the struct vma_area · cf8c9ae8
      Pavel Emelyanov authored
      We have some fields, that are dump-only and some that
      are restore only (quite a lot of them actually).
      
      Reshuffle them on the vma_area to explicitly show which
      one is which. And rename some of them for easier grep.
      Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
      cf8c9ae8
  2. 24 Sep, 2014 2 commits
  3. 23 Sep, 2014 10 commits
  4. 22 Sep, 2014 7 commits
  5. 19 Sep, 2014 12 commits
  6. 18 Sep, 2014 4 commits