public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: Avi Kivity <avi@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	qemu-devel@nongnu.org, Jan Kiszka <jan.kiszka@siemens.com>,
	kvm@vger.kernel.org
Subject: Re: [Qemu-devel] [PATCH] memory: use signed arithmetic
Date: Wed, 3 Aug 2011 01:15:58 +0400 (MSD)	[thread overview]
Message-ID: <alpine.LNX.2.00.1108030115040.3886@linmac> (raw)
In-Reply-To: <1312318249-7011-1-git-send-email-avi@redhat.com>

On Tue, 2 Aug 2011, Avi Kivity wrote:

> When trying to map an alias of a ram region, where the alias starts at
> address A and we map it into address B, and A > B, we had an arithmetic
> underflow.  Because we use unsigned arithmetic, the underflow converted
> into a large number which failed addrrange_intersects() tests.
> 
> The concrete example which triggered this was cirrus vga mapping
> the framebuffer at offsets 0xc0000-0xc7fff (relative to the start of
> the framebuffer) into offsets 0xa0000 (relative to system addres space
> start).
> 
> With our favorite analogy of a windowing system, this is equivalent to
> dragging a subwindow off the left edge of the screen, and failing to clip
> it into its parent window which is on screen.
> 
> Fix by switching to signed arithmetic.

http://stackoverflow.com/questions/3679047/integer-overflow-in-c-standards-and-compilers

In other words UB land

[..snip..]

-- 
mailto:av1474@comtv.ru

  reply	other threads:[~2011-08-02 21:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-02 20:50 [PATCH] memory: use signed arithmetic Avi Kivity
2011-08-02 21:15 ` malc [this message]
2011-08-02 21:21   ` [Qemu-devel] " Avi Kivity
2011-08-02 21:59 ` Richard Henderson
2011-08-02 22:06   ` Avi Kivity
2011-08-02 22:15     ` Richard Henderson
2011-08-03  8:26       ` Avi Kivity
2011-08-03 11:48         ` Benjamin Herrenschmidt

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=alpine.LNX.2.00.1108030115040.3886@linmac \
    --to=av1474@comtv.ru \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=jan.kiszka@siemens.com \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /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