Commit 5b203c1e authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

mnt: Make sure we don't hit nil dereference on nested mount

Such case is actually a BUG but while we can resolve
the situation without real bug-on call lets walk in
a gentle way.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 09d97050
...@@ -359,6 +359,11 @@ static struct mount_info *mnt_build_ids_tree(struct mount_info *list, bool inser ...@@ -359,6 +359,11 @@ static struct mount_info *mnt_build_ids_tree(struct mount_info *list, bool inser
* the main root. * the main root.
*/ */
parent = tmp_root_mount; parent = tmp_root_mount;
if (unlikely(!tmp_root_mount)) {
pr_err("Nested mount %d (@%s %s) w/o root insertion detected\n",
m->mnt_id, m->mountpoint, m->root);
return NULL;
}
pr_debug("Mountpoint %d (@%s) get parent %d (@%s)\n", pr_debug("Mountpoint %d (@%s) get parent %d (@%s)\n",
m->mnt_id, m->mountpoint, m->mnt_id, m->mountpoint,
......
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