From: Scott Wood <scottwood@freescale.com>
To: Alexander Graf <agraf@suse.de>
Cc: Liu Yu <yu.liu@freescale.com>,
qemu-ppc@nongnu.org,
qemu-devel Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] ppc/e500_pci: Fix an array overflow issue
Date: Tue, 27 Sep 2011 12:06:15 -0500 [thread overview]
Message-ID: <4E820287.1090805@freescale.com> (raw)
In-Reply-To: <A1A73068-528D-4914-96A8-768A33E3CDD2@suse.de>
On 09/27/2011 12:01 PM, Alexander Graf wrote:
>
> On 27.09.2011, at 18:52, Scott Wood wrote:
>
>> On 09/27/2011 07:45 AM, Alexander Graf wrote:
>>> So this is the main change, right? Why the -1? A guest could potentially access pib[-1] using this, no?
>>
>> Not with the values of addr that lead to this code. The -1 is because
>> IW1/2/3 are 0x1e0/0x1c0/0x1a0. Previously IW1 would overflow the array.
>
> We're matching on addr & 0xfe0 and do the switch based on that. Possible values are:
>
> 0x1a0
> 0x1c0
> 0x1e0
>
> Then we >> 5 them.
>
> 0xd
> 0xe
> 0xf
>
> ... and & 0x3 them
>
> 0x1
> 0x2
> 0x0
0xd & 0x3 = 1
0xe & 0x3 = 2
0xf & 0x3 = 3
-Scott
prev parent reply other threads:[~2011-09-27 17:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 8:17 [Qemu-devel] [PATCH] ppc/e500_pci: Fix an array overflow issue Liu Yu
2011-09-27 12:45 ` Alexander Graf
2011-09-27 16:52 ` [Qemu-devel] [Qemu-ppc] " Scott Wood
2011-09-27 17:01 ` Alexander Graf
2011-09-27 17:04 ` Richard Henderson
2011-09-27 17:04 ` Alexander Graf
2011-09-27 17:06 ` Scott Wood [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=4E820287.1090805@freescale.com \
--to=scottwood@freescale.com \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=yu.liu@freescale.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;
as well as URLs for NNTP newsgroup(s).