HID: hiddev: validate num_values for HIDIOCGUSAGES, HIDIOCSUSAGES commands

[ Upstream commit 93a2001bdf ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
This commit is contained in:
Scott Bauer 2016-06-23 08:59:47 -06:00 • committed by Sasha Levin
commit 6f562d23f3