• 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
files.c 24.3 KB