]> git.baikalelectronics.ru Git - kernel.git/commit
HID: logitech: fix bounds checking on LED report size
authorJiri Kosina <jkosina@suse.cz>
Thu, 21 Aug 2014 14:56:47 +0000 (09:56 -0500)
committerJiri Kosina <jkosina@suse.cz>
Thu, 21 Aug 2014 15:38:13 +0000 (10:38 -0500)
commit4ce33ad11e6ed40b2170e25bccba46bfbb980930
tree285dfb9a05585d0e7f767c618e1cc8f9e73ce8c6
parentf4ff79363fb218fe0164a8f2b574d9177797e990
HID: logitech: fix bounds checking on LED report size

The check on report size for REPORT_TYPE_LEDS in logi_dj_ll_raw_request()
is wrong; the current check doesn't make any sense -- the report allocated
by HID core in hid_hw_raw_request() can be much larger than
DJREPORT_SHORT_LENGTH, and currently logi_dj_ll_raw_request() doesn't
handle this properly at all.

Fix the check by actually trimming down the report size properly if it is
too large.

Cc: stable@vger.kernel.org
Reported-by: Ben Hawkes <hawkes@google.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-logitech-dj.c