KVM: s390: guestdbg: fix range check
authorDavid Hildenbrand <david@redhat.com>
Wed, 30 Aug 2017 16:06:00 +0000 (18:06 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 31 Aug 2017 11:49:39 +0000 (13:49 +0200)
Looks like the "overflowing" range check is wrong.

|=======b-------a=======|

addr >= a || addr <= b

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170830160603.5452-2-david@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/guestdbg.c

index c2e0ddc1356e551ebd8c466b73956e2574b67436..bcbd86621d018085d036f43d815ae1c97791951c 100644 (file)
@@ -308,7 +308,7 @@ static inline int in_addr_range(u64 addr, u64 a, u64 b)
                return (addr >= a) && (addr <= b);
        else
                /* "overflowing" interval */
-               return (addr <= a) && (addr >= b);
+               return (addr >= a) || (addr <= b);
 }
 
 #define end_of_range(bp_info) (bp_info->addr + bp_info->len - 1)