From c5de05e82fc0e6d2159fd3ff97d26f5516542a08 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Tue, 20 Jun 2017 16:52:39 +0200 Subject: [PATCH] gnttab: correct maptrack table access 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 Reviewed-by: George Dunlap master commit: 4b78efa91c8ae3c42e14b8eaeaad773c5eb3b71a master date: 2017-06-20 14:34:34 +0200 --- xen/common/grant_table.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 52039296eb..ac98aefdc7 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -908,7 +908,9 @@ __gnttab_unmap_common( return; } + smp_rmb(); map = &maptrack_entry(lgt, op->handle); + spin_lock(&lgt->lock); if ( unlikely(!map->flags) ) -- 2.39.5