Skip to contentSkip to conversation

x86/HVM: off-by-1 in new XEN_DOMCTL_ioport_mapping checks

PATCH In review Jan Beulich 2 participants 2 messages Nov 17

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/HVM: off-by-1 in new XEN_DOMCTL_ioport_mapping checks

The new checking introduced not so long ago would wrongly reject exactly adjacent regions.

Fixes fa61af950bb4 ("x86/HVM: more checking for XEN_DOMCTL_ioport_mapping")
xen/arch/x86/domctl.c +2 -2
@@ -756,8 +756,8 @@ long arch_do_domctl(
                     found = 1;
                     break;
                 }
-                if ( fmp + np >= g2m_ioport->mport &&
-                     g2m_ioport->mport + g2m_ioport->np >= fmp )
+                if ( fmp + np > g2m_ioport->mport &&
+                     g2m_ioport->mport + g2m_ioport->np > fmp )
                 {
                     ret = -EBUSY;
                     break;