Commit f43508d2 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

mount: cgroup -- Fix nil dereference

In case if there is no CLONE_NEWCGROUP on root
namespace mask the @private member remains nil
and comparision in mounts_sb_equal leads to nil
dereference.

CC: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Acked-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 61227252
......@@ -305,7 +305,9 @@ static bool mounts_sb_equal(struct mount_info *a, struct mount_info *b)
return false;
}
if (a->fstype->code == FSTYPE__CGROUP && strcmp(a->private, b->private))
if (a->fstype->code == FSTYPE__CGROUP &&
a->private && b->private &&
strcmp(a->private, b->private))
return false;
return a->s_dev == b->s_dev && !strcmp(a->source, b->source);
......
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