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.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
master commit: 56f2ab5b97
master date: 2017-06-20 14:46:01 +0200
This commit is contained in:
Jan Beulich committed 2017-06-20 16:58:35 +02:00
1 parent 6ec173b1e3
commit c07959762e
1 file changed
+7 -4
+7 -4
View File
@@ -736,10 +736,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 )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.