public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Cornelia Huck <cohuck@redhat.com>
To: David Hildenbrand <david@redhat.com>
Cc: kvm@vger.kernel.org,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [PATCH v1 1/4] KVM: s390: guestdbg: fix range check
Date: Thu, 31 Aug 2017 12:13:32 +0200	[thread overview]
Message-ID: <20170831121332.49ccceab.cohuck@redhat.com> (raw)
In-Reply-To: <20170830160603.5452-2-david@redhat.com>

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

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

Huh :)

> 
> Signed-off-by: David Hildenbrand <david@redhat.com>
> ---
>  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@redhat.com>

  reply	other threads:[~2017-08-31 10:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30 16:05 [PATCH v1 0/4] s390x: one fix and three cleanups David Hildenbrand
2017-08-30 16:06 ` [PATCH v1 1/4] KVM: s390: guestdbg: fix range check David Hildenbrand
2017-08-31 10:13   ` Cornelia Huck [this message]
2017-08-31 10:36   ` Christian Borntraeger
2017-08-30 16:06 ` [PATCH v1 2/4] KVM: s390: use WARN_ON_ONCE only for checking David Hildenbrand
2017-08-31 10:16   ` Cornelia Huck
2017-08-31 10:55   ` Christian Borntraeger
2017-08-30 16:06 ` [PATCH v1 3/4] KVM: s390: vsie: cleanup mcck reinjection David Hildenbrand
2017-08-31 11:01   ` Christian Borntraeger
2017-08-31 11:11     ` Cornelia Huck
2017-08-30 16:06 ` [PATCH v1 4/4] KVM: s390: vsie: use common code functions for pinning David Hildenbrand
2017-08-31 11:44   ` Christian Borntraeger
2017-08-31 12:13     ` David Hildenbrand
2017-08-31 12:22       ` Christian Borntraeger
2017-08-31 13:00         ` David Hildenbrand
2017-09-01 12:49           ` Christian Borntraeger
2017-09-01 13:18             ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170831121332.49ccceab.cohuck@redhat.com \
    --to=cohuck@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox