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

[Xen-devel] [PATCH] xen: fix DOMID_IO mapping permission checks



When the permission checks for memory mapping were moved from
get_pg_owner to xsm_mmu_update in aaba7a677, the exception for DOMID_IO
was not taken into account. This will cause IO memory mappings by PV
domains (mini-os in particular) to fail when XSM/FLASK is not being
used. This patch reintroduces the exception for DOMID_IO; the actual
restrictions on IO memory mappings have always been checked separately
using iomem_access_permitted, so this change should not break existing
access control.

Reported-by: Eduardo Peixoto Macedo <epm@xxxxxxxxxxx>
Signed-off-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
---
 xen/include/xsm/dummy.h | 2 ++
 1 file changed, 2 insertions(+)

This will also need to be backported to 4.3.

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index cc0a5a8..f831bc4 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -570,6 +570,8 @@ static XSM_INLINE int xsm_mmu_update(XSM_DEFAULT_ARG struct 
domain *d, struct do
     int rc;
     XSM_ASSERT_ACTION(XSM_TARGET);
     rc = xsm_default_action(action, d, f);
+    if ( t == dom_io )
+        return rc;
     if ( t && !rc )
         rc = xsm_default_action(action, d, t);
     return rc;
-- 
1.8.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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