qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Out off array access in usb-net
Date: Tue, 9 Nov 2010 11:39:01 +0200	[thread overview]
Message-ID: <20101109093901.GM9036@redhat.com> (raw)
In-Reply-To: <m3eiaun8s1.fsf@blackfin.pond.sub.org>

On Tue, Nov 09, 2010 at 10:30:54AM +0100, Markus Armbruster wrote:
> Gleb Natapov <gleb@redhat.com> writes:
> 
> > Properly check array bounds before accessing array element.
> 
> Impact?
> 
Gapping security hole for those unfortunate enough to use usb-net?

> Apply to stable as well?
> 
Definitely. Actually for me Windows7 crashed when usb-net is present.

> > Signed-off-by: Gleb Natapov <gleb@redhat.com>
> > diff --git a/hw/usb-net.c b/hw/usb-net.c
> > index 70f9263..84e2d79 100644
> > --- a/hw/usb-net.c
> > +++ b/hw/usb-net.c
> > @@ -1142,7 +1142,7 @@ static int usb_net_handle_control(USBDevice *dev, int request, int value,
> >                  break;
> >  
> >              default:
> > -                if (usb_net_stringtable[value & 0xff]) {
> > +                if (ARRAY_SIZE(usb_net_stringtable) > (value & 0xff)) {
> >                      ret = set_usb_string(data,
> >                                      usb_net_stringtable[value & 0xff]);
> >                      break;
> 
> Makes sense.
> 
> Nitpick: LIMIT > INDEX looks unusual to me; INDEX < LIMIT is more
> common.

--
			Gleb.

  reply	other threads:[~2010-11-09  9:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09  7:36 [Qemu-devel] [PATCH] Out off array access in usb-net Gleb Natapov
2010-11-09  9:29 ` [Qemu-devel] " Paolo Bonzini
2010-11-09  9:30 ` [Qemu-devel] " Markus Armbruster
2010-11-09  9:39   ` Gleb Natapov [this message]
2010-11-09 10:16     ` Markus Armbruster
2010-11-09 10:34       ` Gleb Natapov
2010-11-09 10:51         ` Markus Armbruster
2010-11-16 20:08           ` Anthony Liguori
2010-11-16 20:14             ` Gleb Natapov
2010-11-16 22:24 ` Anthony Liguori

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=20101109093901.GM9036@redhat.com \
    --to=gleb@redhat.com \
    --cc=armbru@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 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).