aboutsummaryrefslogtreecommitdiff
path: root/sound/pci
diff options
context:
space:
mode:
authorDan Rosenberg <drosenberg@vsecurity.com>2011-03-17 18:32:24 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-23 13:03:59 -0700
commitf97aa1f43ed9e241a05f7e4d2e4afedf97356f7a (patch)
tree95b1c12ca5e082bf33f8ff22b9f2805a5666b9c1 /sound/pci
parentf8cd8789d24ead2e737aae898ab8d5ee0291bb75 (diff)
ALSA: sound/pci/asihpi: check adapter index in hpi_ioctl
commit 4a122c10fbfe9020df469f0f669da129c5757671 upstream. 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> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/asihpi/hpioctl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
index 22dbd91811a..448dd01943f 100644
--- a/sound/pci/asihpi/hpioctl.c
+++ b/sound/pci/asihpi/hpioctl.c
@@ -155,6 +155,11 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
goto out;
}
+ if (hm->h.adapter_index >= HPI_MAX_ADAPTERS) {
+ err = -EINVAL;
+ goto out;
+ }
+
pa = &adapters[hm->h.adapter_index];
hr->h.size = 0;
if (hm->h.object == HPI_OBJ_SUBSYSTEM) {