From: Avi Kivity <avi@redhat.com>
To: wzt wzt <wzt.wzt@gmail.com>
Cc: kvm@vger.kernel.org
Subject: Re: 2.6.32-KVM-pit_ioport_read() integer buffer overflow hole
Date: Tue, 26 Jan 2010 11:03:57 +0200 [thread overview]
Message-ID: <4B5EAFFD.2020706@redhat.com> (raw)
In-Reply-To: <628d1651001260059p65dab6d0y86084b181f5273fc@mail.gmail.com>
On 01/26/2010 10:59 AM, wzt wzt wrote:
> Hi:
> In kernel 2.6.32 kernel/arch/x86/kvm/i8254.c, I found
> pit_ioport_read maybe have a integer buffer overflow hole:
>
> static int pit_ioport_read(struct kvm_io_device *this,
> gpa_t addr, int len, void *data)
> {
> …
> if (len> sizeof(ret))
> len = sizeof(ret);
>
> memcpy(data, (char *)&ret, len); // if len is a negative(< 0),
> the data memory will be buffer overflow.
> …
> }
>
Is there any caller that can send a negative length, user- or guest-
controlled?
--
error compiling committee.c: too many arguments to function
prev parent reply other threads:[~2010-01-26 9:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-26 8:59 2.6.32-KVM-pit_ioport_read() integer buffer overflow hole wzt wzt
2010-01-26 9:03 ` 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=4B5EAFFD.2020706@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=wzt.wzt@gmail.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