From: Jan Beulich Date: Fri, 2 Jun 2017 14:21:27 +0000 (+0100) Subject: gnttab: never create host mapping unless asked to X-Git-Tag: archive/raspbian/4.8.1-1+rpi1+deb9u3^2~10 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f6d094af09acf07806f246a0153d2484167d3d73;p=xen.git gnttab: never create host mapping unless asked to We shouldn't create a host mapping unless asked to even in the case of mapping a granted MMIO page. In particular the mapping wouldn't be torn down when processing the matching unmap request. This is part of XSA-224. Reported-by: Jan Beulich Signed-off-by: Jan Beulich Gbp-Pq: Name gnttab-never-create-host-mapping-unless- --- diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 548550bf96..28d5015d4f 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -911,10 +911,13 @@ __gnttab_map_grant_ref( goto undo_out; } - rc = create_grant_host_mapping( - op->host_addr, frame, op->flags, cache_flags); - if ( rc != GNTST_okay ) - goto undo_out; + if ( op->flags & GNTMAP_host_map ) + { + rc = create_grant_host_mapping(op->host_addr, frame, op->flags, + cache_flags); + if ( rc != GNTST_okay ) + goto undo_out; + } } else if ( owner == rd || owner == dom_cow ) {