From: Avi Kivity <avi@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: agraf@suse.de, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Fix subtle integer overflow bug in memory API
Date: Thu, 15 Sep 2011 10:43:13 +0300 [thread overview]
Message-ID: <4E71AC91.7000709@redhat.com> (raw)
In-Reply-To: <4E71AB6B.7040900@redhat.com>
On 09/15/2011 10:38 AM, Paolo Bonzini wrote:
> On 09/15/2011 04:34 AM, David Gibson wrote:
>> explicit "if (a + b)< a" tests in some places.
>
> Please wrap these in a macro, since the addition has to be done in an
> unsigned type. Otherwise overflow is undefined.
It doesn't help if the overflow is defined but produces an incorrect result.
The fact is we need a 64+N bit datatype, where N is the nesting level of
MemoryRegions (including aliases). Each nesting level can overflow a
bit. Right now the only viable options seems to be #define 64 60, but
I'll be happy to consider others.
--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.
prev parent reply other threads:[~2011-09-15 7:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-14 7:02 [Qemu-devel] [PATCH] Fix subtle integer overflow bug in memory API David Gibson
2011-09-14 8:23 ` Avi Kivity
2011-09-14 8:38 ` Avi Kivity
2011-09-15 2:34 ` David Gibson
2011-09-15 2:58 ` David Gibson
2011-09-15 7:28 ` Avi Kivity
2011-09-16 3:16 ` David Gibson
2011-09-15 7:38 ` Paolo Bonzini
2011-09-15 7:43 ` Avi Kivity [this message]
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=4E71AC91.7000709@redhat.com \
--to=avi@redhat.com \
--cc=agraf@suse.de \
--cc=pbonzini@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.