]> xenbits.xensource.com Git - xen.git/commitdiff
gnttab: correct maptrack table access
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 14:52:39 +0000 (16:52 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 14:52:39 +0000 (16:52 +0200)
In order to observe a consistent (limit,pointer-table) pair, the reader
needs to either hold the grant table lock or both sides need to order
their accesses suitably (the writer side barrier is already there). Add
the missing barrier.

This is part of XSA-218.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
master commit: 4b78efa91c8ae3c42e14b8eaeaad773c5eb3b71a
master date: 2017-06-20 14:34:34 +0200

xen/common/grant_table.c

index 52039296eb407123ab0e3bbdb41d93cf40338cd6..ac98aefdc7cadb98b83387a9c7174e0df628f77c 100644 (file)
@@ -908,7 +908,9 @@ __gnttab_unmap_common(
         return;
     }
 
+    smp_rmb();
     map = &maptrack_entry(lgt, op->handle);
+
     spin_lock(&lgt->lock);
 
     if ( unlikely(!map->flags) )