Skip to content

Commit da92e41

Browse files
jbeulichgregkh
authored andcommitted
Xen/x86: also check kernel mapping in set_foreign_p2m_mapping()
commit b512e1b 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: Jan Beulich <jbeulich@suse.com> Cc: stable@vger.kernel.org Reviewed-by: Juergen Gross <jgross@suse.com> Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 104eef9 commit da92e41

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

arch/x86/xen/p2m.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,8 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops,
716716
unsigned long mfn, pfn;
717717

718718
/* Do not add to override if the map failed. */
719-
if (map_ops[i].status)
719+
if (map_ops[i].status != GNTST_okay ||
720+
(kmap_ops && kmap_ops[i].status != GNTST_okay))
720721
continue;
721722

722723
if (map_ops[i].flags & GNTMAP_contains_pte) {

0 commit comments

Comments
 (0)