All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, zhang.zhanghailiang@huawei.com,
	peter.huangpeng@huawei.com
Subject: Re: [Qemu-trivial] [PATCH] vt82c686: avoid out-of-bounds read
Date: Thu, 11 Dec 2014 20:05:19 +0100	[thread overview]
Message-ID: <5489EAEF.1010600@redhat.com> (raw)
In-Reply-To: <5489DA78.9030003@msgid.tls.msk.ru>



On 11/12/2014 18:55, Michael Tokarev wrote:
>> > superio_ioport_readb can read the 256th element of the array.
> Is there a legitimate reason for it to access byte index 256?

The 256th element is byte index 255. :)

> What is the actual size of superio config memory, 256 or 257?

It's 256 and the array is sized conf[0xff].

> I don't know, but somehow it looks like it should be 256.

That's what the patch does. :)

Paolo


WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: Michael Tokarev <mjt@tls.msk.ru>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, zhang.zhanghailiang@huawei.com,
	peter.huangpeng@huawei.com
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] vt82c686: avoid out-of-bounds read
Date: Thu, 11 Dec 2014 20:05:19 +0100	[thread overview]
Message-ID: <5489EAEF.1010600@redhat.com> (raw)
In-Reply-To: <5489DA78.9030003@msgid.tls.msk.ru>



On 11/12/2014 18:55, Michael Tokarev wrote:
>> > superio_ioport_readb can read the 256th element of the array.
> Is there a legitimate reason for it to access byte index 256?

The 256th element is byte index 255. :)

> What is the actual size of superio config memory, 256 or 257?

It's 256 and the array is sized conf[0xff].

> I don't know, but somehow it looks like it should be 256.

That's what the patch does. :)

Paolo

  reply	other threads:[~2014-12-11 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-10  9:17 [Qemu-trivial] [PATCH] vt82c686: avoid out-of-bounds read Paolo Bonzini
2014-12-10  9:17 ` [Qemu-devel] " Paolo Bonzini
2014-12-10  9:31 ` [Qemu-trivial] " zhanghailiang
2014-12-10  9:31   ` [Qemu-devel] " zhanghailiang
2014-12-10  9:52   ` [Qemu-trivial] " Paolo Bonzini
2014-12-10  9:52     ` [Qemu-devel] " Paolo Bonzini
2014-12-11  8:35 ` [Qemu-trivial] " zhanghailiang
2014-12-11  8:35   ` [Qemu-devel] " zhanghailiang
2014-12-11 17:55 ` [Qemu-trivial] " Michael Tokarev
2014-12-11 17:55   ` [Qemu-devel] " Michael Tokarev
2014-12-11 19:05   ` Paolo Bonzini [this message]
2014-12-11 19:05     ` Paolo Bonzini
2015-01-12  8:49 ` Michael Tokarev
2015-01-12  8:49   ` [Qemu-devel] " Michael Tokarev

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=5489EAEF.1010600@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=mjt@tls.msk.ru \
    --cc=peter.huangpeng@huawei.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.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 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.