|
|
@@ -22,9 +22,9 @@
|
|
|
#include <sound/core.h>
|
|
|
#include <sound/hwdep.h>
|
|
|
#include <linux/uaccess.h>
|
|
|
+#include <linux/nospec.h>
|
|
|
#include "emux_voice.h"
|
|
|
|
|
|
-
|
|
|
#define TMP_CLIENT_ID 0x1001
|
|
|
|
|
|
/*
|
|
|
@@ -66,13 +66,16 @@ snd_emux_hwdep_misc_mode(struct snd_emux *emu, void __user *arg)
|
|
|
return -EFAULT;
|
|
|
if (info.mode < 0 || info.mode >= EMUX_MD_END)
|
|
|
return -EINVAL;
|
|
|
+ info.mode = array_index_nospec(info.mode, EMUX_MD_END);
|
|
|
|
|
|
if (info.port < 0) {
|
|
|
for (i = 0; i < emu->num_ports; i++)
|
|
|
emu->portptrs[i]->ctrls[info.mode] = info.value;
|
|
|
} else {
|
|
|
- if (info.port < emu->num_ports)
|
|
|
+ if (info.port < emu->num_ports) {
|
|
|
+ info.port = array_index_nospec(info.port, emu->num_ports);
|
|
|
emu->portptrs[info.port]->ctrls[info.mode] = info.value;
|
|
|
+ }
|
|
|
}
|
|
|
return 0;
|
|
|
}
|