]> git.baikalelectronics.ru Git - kernel.git/commit
Xen/gnttab: handle p2m update errors on a per-slot basis
authorJan Beulich <jbeulich@suse.com>
Thu, 25 Feb 2021 15:34:43 +0000 (16:34 +0100)
committerJuergen Gross <jgross@suse.com>
Wed, 3 Mar 2021 07:32:10 +0000 (08:32 +0100)
commit303f688ff28eaa601b0afe172c81d7add1150095
treedc46610b494e5a1aa518604ce189ad0dbe239448
parentdfc63b4459394dfd5b0450786721cc235dcd8d94
Xen/gnttab: handle p2m update errors on a per-slot basis

Bailing immediately from set_foreign_p2m_mapping() upon a p2m updating
error leaves the full batch in an ambiguous state as far as the caller
is concerned. Instead flags respective slots as bad, unmapping what
was mapped there right away.

HYPERVISOR_grant_table_op()'s return value and the individual unmap
slots' status fields get used only for a one-time - there's not much we
can do in case of a failure.

Note that there's no GNTST_enomem or alike, so GNTST_general_error gets
used.

The map ops' handle fields get overwritten just to be on the safe side.

This is part of XSA-367.

Cc: <stable@vger.kernel.org>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/96cccf5d-e756-5f53-b91a-ea269bfb9be0@suse.com
Signed-off-by: Juergen Gross <jgross@suse.com>
arch/arm/xen/p2m.c
arch/x86/xen/p2m.c