]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/PV: fix off-by-one in I/O bitmap limit check
authorJan Beulich <jbeulich@suse.com>
Tue, 27 Feb 2018 13:10:00 +0000 (14:10 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 27 Feb 2018 13:10:00 +0000 (14:10 +0100)
With everyone having their tags below agreeing that putting things the
other way around in the comparison makes things easier to understand, do
that rearrangement while changing the line anyway.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.apu@citrix.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/pv/emul-priv-op.c

index a6bad88488b2d1050dfc65868795d6e4ed0b932d..ecb3b9c47b7a6d46c1a01ebd01af71e075784f37 100644 (file)
@@ -136,7 +136,7 @@ static bool guest_io_okay(unsigned int port, unsigned int bytes,
     if ( iopl_ok(v, regs) )
         return true;
 
-    if ( v->arch.pv_vcpu.iobmp_limit > (port + bytes) )
+    if ( (port + bytes) <= v->arch.pv_vcpu.iobmp_limit )
     {
         union { uint8_t bytes[2]; uint16_t mask; } x;