aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/pci/asihpi/hpioctl.c
diff options
context:
space:
mode:
authorEliot Blennerhassett <eliot@blennerhassett.gen.nz>2014-12-31 23:48:32 +1300
committerTakashi Iwai <tiwai@suse.de>2014-12-31 14:12:43 +0100
commit0d02e1292715d00674a49626146e3a854b504cb1 (patch)
treea0ac354d0799db7e834d0af19e45a496acffb0ac /sound/pci/asihpi/hpioctl.c
parentMerge branch 'topic/pcm-params' into for-next (diff)
downloadwireguard-linux-0d02e1292715d00674a49626146e3a854b504cb1.tar.xz
wireguard-linux-0d02e1292715d00674a49626146e3a854b504cb1.zip
ALSA: asihpi: fix an information leak in asihpi_hpi_ioctl()
Add missing limits to keep copied data within allocated buffer. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eliot Blennerhassett <eliot@blennerhassett.gen.nz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/asihpi/hpioctl.c')
-rw-r--r--sound/pci/asihpi/hpioctl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/pci/asihpi/hpioctl.c b/sound/pci/asihpi/hpioctl.c
index 6aa677e60555..72af66bdf714 100644
--- a/sound/pci/asihpi/hpioctl.c
+++ b/sound/pci/asihpi/hpioctl.c
@@ -153,6 +153,8 @@ long asihpi_hpi_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
goto out;
}
+ res_max_size = min_t(size_t, res_max_size, sizeof(*hr));
+
switch (hm->h.function) {
case HPI_SUBSYS_CREATE_ADAPTER:
case HPI_ADAPTER_DELETE: