summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2021-02-15 08:52:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-02-23 15:53:24 +0100
commitbe89a0300a58c273b6f48bb8db01c807e203098b (patch)
tree898b506fd13d5343f3ca431021d7e932b19a261c /include
parent1a5c2274349f5b6f3b6bbdf43247e71a50ae6e2f (diff)
Xen/gntdev: correct error checking in gntdev_map_grant_pages()
commit ebee0eab08594b2bd5db716288a4f1ae5936e9bc upstream. Failure of the kernel part of the mapping operation should also be indicated as an error to the caller, or else it may assume the respective kernel VA is okay to access. Furthermore gnttab_map_refs() failing still requires recording successfully mapped handles, so they can be unmapped subsequently. This in turn requires there to be a way to tell full hypercall failure from partial success - preset map_op status fields such that they won't "happen" to look as if the operation succeeded. Also again 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>
Diffstat (limited to 'include')
-rw-r--r--include/xen/grant_table.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index b9c937b3a149..0b1182a3cf41 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -157,6 +157,7 @@ gnttab_set_map_op(struct gnttab_map_grant_ref *map, phys_addr_t addr,
map->flags = flags;
map->ref = ref;
map->dom = domid;
+ map->status = 1; /* arbitrary positive value */
}
static inline void