]> git.baikalelectronics.ru Git - kernel.git/commit
Xen/gntdev: correct error checking in gntdev_map_grant_pages()
authorJan Beulich <jbeulich@suse.com>
Mon, 15 Feb 2021 07:52:27 +0000 (08:52 +0100)
committerJuergen Gross <jgross@suse.com>
Mon, 15 Feb 2021 07:52:27 +0000 (08:52 +0100)
commitb7bf4273d5d7f78761e90f08cb10a48946f8d4ae
tree6909d43dcfd4186da3a99ecdbacd81351d2b4f49
parented21383c963d1b487141058d4df4303b71339c38
Xen/gntdev: correct error checking in gntdev_map_grant_pages()

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>
drivers/xen/gntdev.c
include/xen/grant_table.h