OpenCloudOS-Kernel/sound/pci/asihpi
Meng Xu e1af344df4 ALSA: asihpi: fix a potential double-fetch bug when copying puhm
The hm->h.size is intended to hold the actual size of the hm struct
that is copied from userspace and should always be <= sizeof(*hm).

However, after copy_from_user(hm, puhm, hm->h.size), since userspace
process has full control over the memory region pointed by puhm, it is
possible that the value of hm->h.size is different from what is fetched-in
previously (get_user(hm->h.size, (u16 __user *)puhm)). In other words,
hm->h.size is overriden and the relation between hm->h.size and the hm
struct is broken.

This patch proposes to use a seperate variable, msg_size, to hold
the value of the first fetch and override hm->h.size to msg_size
after the second fetch to maintain the relation.

Signed-off-by: Meng Xu <mengxu.gatech@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-09-19 22:03:59 +02:00
..
Makefile ALSA: Add support of AudioScience ASI boards 2010-04-22 07:21:53 +02:00
asihpi.c ALSA: asihpi: Kill BUG_ON() usages 2017-09-07 10:52:37 +02:00
hpi.h ALSA: asihpi: New I/O types - AVB & BLUlink, DAB Rf receiver 2014-11-22 22:25:51 +01:00
hpi6000.c ALSA: asihpi: fix an information leak in asihpi_hpi_ioctl() 2014-12-31 14:12:43 +01:00
hpi6000.h ALSA: asihpi - Update copyright to 2011 2011-12-22 08:12:57 +01:00
hpi6205.c ALSA: asihpi: Add support for stream interrupt. 2014-11-22 22:33:13 +01:00
hpi6205.h ALSA: asihpi - Increase request and response buffer sizes 2011-07-22 07:45:26 +02:00
hpi_internal.h ALSA: asihpi: increase tuner pad cache size 2014-12-18 08:48:24 +01:00
hpi_version.h ALSA: asihpi: update to HPI version 4.14 2014-12-18 08:48:47 +01:00
hpicmn.c ALSA: asihpi: Refactor control cache code. 2014-11-22 22:29:58 +01:00
hpicmn.h ALSA: asihpi: Add support for stream interrupt. 2014-11-22 22:33:13 +01:00
hpidebug.c ALSA: asihpi: Put missing KERN_CONT prefix 2017-08-31 11:01:31 +02:00
hpidebug.h ALSA: asihpi - Update copyright to 2011 2011-12-22 08:12:57 +01:00
hpidspcd.c ALSA: asihpi: relax firmware version check 2014-12-18 08:40:06 +01:00
hpidspcd.h ALSA: asihpi - Split hpi version info into separate header file. 2011-12-22 08:12:56 +01:00
hpifunc.c ALSA: squash lines for simple wrapper functions 2016-09-07 20:35:29 +02:00
hpimsginit.c ALSA: asihpi: used parts of message/response are zeroed before use 2014-11-22 22:34:06 +01:00
hpimsginit.h ALSA: asihpi - Update copyright to 2011 2011-12-22 08:12:57 +01:00
hpimsgx.c ALSA: asihpi: Turn off msg/resp logging after DSP has crashed. 2014-11-22 22:33:25 +01:00
hpimsgx.h ALSA: asihpi - Update copyright to 2011 2011-12-22 08:12:57 +01:00
hpioctl.c ALSA: asihpi: fix a potential double-fetch bug when copying puhm 2017-09-19 22:03:59 +02:00
hpioctl.h ALSA: pci: remove __dev* attributes 2012-12-07 07:20:55 +01:00
hpios.c ALSA: asihpi - fix return value of hpios_locked_mem_alloc() 2012-03-30 16:24:48 +02:00
hpios.h ALSA: asihpi: Add support for stream interrupt. 2014-11-22 22:33:13 +01:00
hpipcida.h ALSA: asihpi - Update copyright to 2011 2011-12-22 08:12:57 +01:00