From: Juergen Kreileder <jk@blackdown.de>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: alsa-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [patch] Fix snd-usb-audio in 32-bit compat environemt
Date: Sun, 19 Feb 2006 20:02:03 +0100 [thread overview]
Message-ID: <87hd6vw4t0.fsf@blackdown.de> (raw)
In-Reply-To: <20060219175646.GB7797@mipter.zuzino.mipt.ru> (Alexey Dobriyan's message of "Sun, 19 Feb 2006 20:56:46 +0300")
Alexey Dobriyan <adobriyan@gmail.com> writes:
> On Sat, Feb 18, 2006 at 07:50:37PM +0100, Juergen Kreileder wrote:
>> I'm getting oopses with snd-usb-audio in 32-bit compat
>> environments: control_compat.c:get_ctl_type() doesn't initialize
>> 'info', so
>> 'itemlist[uinfo->value.enumerated.item]' in
>> usbmixer.c:mixer_ctl_selector_info() might access random memory
>> (The 'if ((int)uinfo->value.enumerated.item >= cval->max)' doesn't fix
>> all problems because of the unsigned -> signed conversion.)
>
> IMO, what you did is an overkill.
The advantage of the longer fix is reduced stack usage.
> Does this patch fixes your problem?
Yes but you can have that even simpler:
--- linux-mm-vanilla/sound/core/control_compat.c 2006-02-18 17:00:17.000000000 +0100
+++ linux-mm/sound/core/control_compat.c 2006-02-19 19:41:51.000000000 +0100
@@ -167,7 +167,7 @@ static int get_ctl_type(struct snd_card
int *countp)
{
struct snd_kcontrol *kctl;
- struct snd_ctl_elem_info info;
+ struct snd_ctl_elem_info info = {0};
int err;
down_read(&card->controls_rwsem);
=
Juergen
--
Juergen Kreileder, Blackdown Java-Linux Team
http://blog.blackdown.de/
next prev parent reply other threads:[~2006-02-19 19:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-18 18:50 [patch] Fix snd-usb-audio in 32-bit compat environemt Juergen Kreileder
2006-02-18 18:50 ` Juergen Kreileder
2006-02-19 17:56 ` Alexey Dobriyan
2006-02-19 17:56 ` Alexey Dobriyan
2006-02-19 19:02 ` Juergen Kreileder [this message]
2006-02-20 11:09 ` Takashi Iwai
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=87hd6vw4t0.fsf@blackdown.de \
--to=jk@blackdown.de \
--cc=adobriyan@gmail.com \
--cc=alsa-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.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 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.