guest_physmap_remove_page() needs its return value checked
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 12:41:16 +0000 (14:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 12:41:16 +0000 (14:41 +0200)
commita0cce6048d010a30ac82f8db7787bbf9aada64f4
treeb85cebc54769ca2dee2ceef8a8db01734d71a98d
parentb614f642c35da5184416787352f51a6379a92628
guest_physmap_remove_page() needs its return value checked

Callers, namely such subsequently freeing the page, must not blindly
assume success - the function may namely fail when needing to shatter a
super page, but there not being memory available for the then needed
intermediate page table.

As it happens, guest_remove_page() callers now also all check the
return value.

Furthermore a missed put_gfn() on an error path in gnttab_transfer() is
also being taken care of.

This is part of XSA-222.

Reported-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
13 files changed:
xen/arch/arm/mm.c
xen/arch/arm/p2m.c
xen/arch/x86/domain.c
xen/arch/x86/hvm/ioreq.c
xen/arch/x86/mm.c
xen/arch/x86/mm/p2m.c
xen/common/grant_table.c
xen/common/memory.c
xen/drivers/passthrough/arm/smmu.c
xen/include/asm-arm/p2m.h
xen/include/asm-x86/p2m.h
xen/include/xen/mm.h
xen/include/xen/p2m-common.h