Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Eliot Blennerhassett <linux@audioscience.com>
To: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	"open list:SOUND" <alsa-devel@alsa-project.org>,
	kernel-janitors@vger.kernel.org,
	Dan Carpenter <error27@gmail.com>
Subject: Re: [patch] ALSA: asihpi - off by one in asihpi_hpi_ioctl()
Date: Thu, 28 Jul 2011 09:45:22 +1200	[thread overview]
Message-ID: <4E3086F2.80606@audioscience.com> (raw)
In-Reply-To: <1311771302.2125.7.camel@osiris>

On 28/07/11 00:55, Dan Rosenberg wrote:
> On Wed, 2011-07-27 at 15:02 +0300, Dan Carpenter wrote:
>> "adapter" is used as an array index in the adapters[] array so
>> the off by one would make us read past the end.
>>
> 
> Agreed. I also don't like the fact that the "pa" pointer can be set to
> an arbitrary address because the index isn't checked until after its
> assignment. Even though the fix to the check prevents this pointer from
> being dereferenced if it's out-of-bounds, it's still wrong.

:( I have to agree.
I'll submit another patch that avoids doing this.

> I agree.  This code seems to make assumptions in more than one place
> that the adapters array is fully populated with non-NULL elements.  At a
> glance, I can't see where such initialization occurs though.

It does, in void __init asihpi_init(void)
...	memset(adapters, 0, sizeof(adapters));

-- 
Eliot Blennerhassett
AudioScience Inc.

      parent reply	other threads:[~2011-07-27 21:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 12:02 [patch] ALSA: asihpi - off by one in asihpi_hpi_ioctl() Dan Carpenter
2011-07-27 14:05 ` Takashi Iwai
     [not found] ` <1311771302.2125.7.camel@osiris>
     [not found]   ` <1311771733.2125.9.camel@osiris>
2011-07-27 13:06     ` Takashi Iwai
2011-07-27 21:45   ` Eliot Blennerhassett [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=4E3086F2.80606@audioscience.com \
    --to=linux@audioscience.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=drosenberg@vsecurity.com \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=tiwai@suse.de \
    /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