Commit 58696c72 authored by Stanislav Kinsburskiy's avatar Stanislav Kinsburskiy Committed by Pavel Emelyanov

autofs: fix double close of pid ns fd

Restore_ns helper closes passed namepsace fd unconditionally.
Thus new_pid_ns must be invalidated in any case after calling for it.
Signed-off-by: 's avatarStanislav Kinsburskiy <skinsbursky@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 49bfd954
......@@ -371,11 +371,12 @@ static int access_autofs_mount(struct mount_info *pm)
goto close_old_pid_ns;
}
if (restore_ns(new_pid_ns, &pid_ns_desc)) {
err = restore_ns(new_pid_ns, &pid_ns_desc);
new_pid_ns = -1;
if (err) {
pr_err("failed to restore pid namespace\n");
goto restore_mnt_ns;
}
new_pid_ns = -1;
autofs_mnt = autofs_mnt_open(mnt_path, dev_id);
if (autofs_mnt < 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment