Commit a46248c8 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

mount: don't close a namespace descriptor two times

CID null (#1 of 1): Double close (USE_AFTER_FREE)
10. double_close: Calling "restore_ns(int, struct ns_desc *)" closes
handle "ns_old" which has already been closed.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9959a2a9
......@@ -455,8 +455,10 @@ static DIR *open_mountpoint(struct mount_info *pm)
if (fd < 0)
goto out;
if (restore_ns(ns_old, &mnt_ns_desc))
if (restore_ns(ns_old, &mnt_ns_desc)) {
ns_old = -1;
goto out;
}
return __open_mountpoint(pm, fd);;
out:
......
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