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

ids: Make sure the kIDs obtained from root_ids are sane

Otherwise we will get nil dereference in shared_fdt_prepare
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent f0a4b4bf
......@@ -510,6 +510,17 @@ static int prepare_pstree_kobj_ids(void)
if (cflags & CLONE_FILES) {
int ret;
/*
* There might be a case when kIDs for
* root task are the same as in root_ids,
* thus it's image corruption and we should
* exit out.
*/
if (unlikely(!item->parent)) {
pr_err("Image corruption on kIDs data\n");
return -1;
}
ret = shared_fdt_prepare(item);
if (ret)
return ret;
......
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