提交 0ff2c6c1 编写于 作者: J Jan Beulich 提交者: Cheng Jian

Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()

stable inclusion
from linux-4.19.177
commit c3d586afdb4474f9389eeddf6c9259e33cc0a321
CVE: CVE-2021-26932

--------------------------------

commit b512e1b0 upstream.

We should not set up further state if either mapping failed; paying
attention to just the user mapping's status isn't enough.

Also use GNTST_okay instead of implying its value (zero).

This is part of XSA-361.
Signed-off-by: NJan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: NJuergen Gross <jgross@suse.com>
Signed-off-by: NJuergen Gross <jgross@suse.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NXiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 7653f431
...@@ -708,7 +708,8 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, ...@@ -708,7 +708,8 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
unsigned long mfn, pfn; unsigned long mfn, pfn;
/* Do not add to override if the map failed. */ /* Do not add to override if the map failed. */
if (map_ops[i].status) if (map_ops[i].status != GNTST_okay ||
(kmap_ops && kmap_ops[i].status != GNTST_okay))
continue; continue;
if (map_ops[i].flags & GNTMAP_contains_pte) { if (map_ops[i].flags & GNTMAP_contains_pte) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册