Commit 74504a63 authored by Jan Beulich's avatar Jan Beulich Committed by Zheng Zengkai
Browse files

Xen/gntdev: correct error checking in gntdev_map_grant_pages()



stable inclusion
from stable-5.10.18
commit be89a0300a58c273b6f48bb8db01c807e203098b
bugzilla: 50148

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

commit ebee0eab 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: default avatarJan Beulich <jbeulich@suse.com>
Cc: stable@vger.kernel.org
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
parent 3a43f113
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment