/[linux-patches]/genpatches-2.6/trunk/2.6.14/1450_15.5_usb-audio-32bit-compat.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1450_15.5_usb-audio-32bit-compat.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 8 months ago) by johnm
File MIME type: text/x-diff
File size: 1855 byte(s)
2.6.14-11, rebase against local tree
1 From: Juergen Kreileder <jk@blackdown.de>
2 Date: Tue, 21 Feb 2006 02:28:00 +0000 (-0800)
3 Subject: [PATCH] Fix snd-usb-audio in 32-bit compat environment
4 X-Git-Url: http://www.kernel.org/git/?p=linux/kernel/git/chrisw/linux-2.6.15.y.git;a=commitdiff;h=46cadda8ed7d32f0435699b3c2cfe5973785b4c1
5
6 [PATCH] Fix snd-usb-audio in 32-bit compat environment
7
8 I'm getting oopses with snd-usb-audio in 32-bit compat environments:
9 control_compat.c:get_ctl_type() doesn't initialize 'info', so
10 'itemlist[uinfo->value.enumerated.item]' in
11 usbmixer.c:mixer_ctl_selector_info() might access random memory (The 'if
12 ((int)uinfo->value.enumerated.item >= cval->max)' doesn't fix all problems
13 because of the unsigned -> signed conversion.)
14
15 Signed-off-by: Juergen Kreileder <jk@blackdown.de>
16 Cc: Jaroslav Kysela <perex@suse.cz>
17 Acked-by: Takashi Iwai <tiwai@suse.de>
18 Signed-off-by: Andrew Morton <akpm@osdl.org>
19 Signed-off-by: Chris Wright <chrisw@sous-sol.org>
20 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
21 ---
22
23 --- a/sound/core/control_compat.c
24 +++ b/sound/core/control_compat.c
25 @@ -164,7 +164,7 @@ struct sndrv_ctl_elem_value32 {
26 static int get_ctl_type(snd_card_t *card, snd_ctl_elem_id_t *id, int *countp)
27 {
28 snd_kcontrol_t *kctl;
29 - snd_ctl_elem_info_t info;
30 + snd_ctl_elem_info_t *info;
31 int err;
32
33 down_read(&card->controls_rwsem);
34 @@ -173,13 +173,19 @@ static int get_ctl_type(snd_card_t *card
35 up_read(&card->controls_rwsem);
36 return -ENXIO;
37 }
38 - info.id = *id;
39 - err = kctl->info(kctl, &info);
40 + info = kzalloc(sizeof(*info), GFP_KERNEL);
41 + if (info == NULL) {
42 + up_read(&card->controls_rwsem);
43 + return -ENOMEM;
44 + }
45 + info->id = *id;
46 + err = kctl->info(kctl, info);
47 up_read(&card->controls_rwsem);
48 if (err >= 0) {
49 - err = info.type;
50 - *countp = info.count;
51 + err = info->type;
52 + *countp = info->count;
53 }
54 + kfree(info);
55 return err;
56 }
57

  ViewVC Help
Powered by ViewVC 1.1.20