diff options
author | Dan Rosenberg <drosenberg@vsecurity.com> | 2011-03-17 18:32:24 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-03-18 02:38:29 -0400 |
commit | 4a122c10fbfe9020df469f0f669da129c5757671 (patch) | |
tree | 57a707d3331c59f18f65dd9dfc1610944e461d7d | |
parent | 98d21df431ad55281e1abf780f8d51e3391900b2 (diff) |
ALSA: sound/pci/asihpi: check adapter index in hpi_ioctl
The user-supplied index into the adapters array needs to be checked, or
an out-of-bounds kernel pointer could be accessed and used, leading to
potentially exploitable memory corruption.
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/asihpi/hpioctl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c index 26186be638b1..cd624f13ff8e 100644 --- a/sound/pci/asihpi/hpioctl.c +++ b/sound/pci/asihpi/hpioctl.c | |||
@@ -156,6 +156,11 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
156 | goto out; | 156 | goto out; |
157 | } | 157 | } |
158 | 158 | ||
159 | if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) { | ||
160 | err = -EINVAL; | ||
161 | goto out; | ||
162 | } | ||
163 | |||
159 | pa = &adapters[hm->h.adapter_index]; | 164 | pa = &adapters[hm->h.adapter_index]; |
160 | hr->h.size = res_max_size; | 165 | hr->h.size = res_max_size; |
161 | if (hm->h.object == HPI_OBJ_SUBSYSTEM) { | 166 | if (hm->h.object == HPI_OBJ_SUBSYSTEM) { |