提交 4a122c10 编写于 作者: D Dan Rosenberg 提交者: Takashi Iwai

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: NDan Rosenberg <drosenberg@vsecurity.com>
Cc: <stable@kernel.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 98d21df4
......@@ -156,6 +156,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 = res_max_size;
if (hm->h.object == HPI_OBJ_SUBSYSTEM) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册