Re: [PATCH v1 1/4] KVM: s390: guestdbg: fix range check

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

 



On Wed, 30 Aug 2017 18:06:00 +0200
David Hildenbrand <david@xxxxxxxxxx> wrote:

> Looks like the "overflowing" range check is wrong.
> 
> |=======b-------a=======|
> 
> addr >= a || addr <= b

Huh :)

> 
> Signed-off-by: David Hildenbrand <david@xxxxxxxxxx>
> ---
>  arch/s390/kvm/guestdbg.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kvm/guestdbg.c b/arch/s390/kvm/guestdbg.c
> index c2e0ddc1356e..bcbd86621d01 100644
> --- a/arch/s390/kvm/guestdbg.c
> +++ b/arch/s390/kvm/guestdbg.c
> @@ -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)

Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux