]> git.baikalelectronics.ru Git - kernel.git/commit
HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands
authorScott Bauer <sbauer@plzdonthack.me>
Thu, 23 Jun 2016 14:59:47 +0000 (08:59 -0600)
committerJiri Kosina <jkosina@suse.cz>
Fri, 24 Jun 2016 08:21:39 +0000 (10:21 +0200)
commit702e8748ca6f74bc959c8736dc986a5aa4b3aa3e
tree4f6341f923285f2e1428ec4992f5540a6ec4d482
parent51c6360341cee9182848fdb51cf2e94efa44ca46
HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands

This patch validates the num_values parameter from userland during the
HIDIOCGUSAGES and HIDIOCSUSAGES commands. Previously, if the report id was set
to HID_REPORT_ID_UNKNOWN, we would fail to validate the num_values parameter
leading to a heap overflow.

Cc: stable@vger.kernel.org
Signed-off-by: Scott Bauer <sbauer@plzdonthack.me>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/usbhid/hiddev.c