]> xenbits.xensource.com Git - xen.git/commitdiff
x86/PV: fix off-by-one in I/O bitmap limit check
authorJan Beulich <jbeulich@suse.com>
Tue, 6 Mar 2018 15:24:01 +0000 (16:24 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 6 Mar 2018 15:24:01 +0000 (16:24 +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>
master commit: c6527bc66b6dd7a8dadaebb1047c8e52c6c5793c
master date: 2018-02-27 14:10:00 +0100

xen/arch/x86/traps.c

index 51e471ef3b9e5224446d263f6b3686eaf71329b0..7a186985df821445ce60bde8c4b75030095b3caf 100644 (file)
@@ -1951,7 +1951,7 @@ static int guest_io_okay(
     if ( iopl_ok(v, regs) )
         return 1;
 
-    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;