[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.7] gnttab: never create host mapping unless asked to



commit 3b4fdddf55d40cffd821289e13ad883b6d901f33
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Jun 20 16:20:17 2017 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Jun 20 16:20:17 2017 +0200

    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@xxxxxxxx>
    master commit: 56f2ab5b970f1b18cf2019df4bf27db544cda6ea
    master date: 2017-06-20 14:46:01 +0200
---
 xen/common/grant_table.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c
index 3c9b6fa..0102d32 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 )
     {
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.7

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.