HID: LG: validate HID output report details
authorKees Cook <keescook@chromium.org>
Wed, 11 Sep 2013 19:56:54 +0000 (21:56 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Mon, 10 Feb 2014 21:10:47 +0000 (16:10 -0500)
commit9c3c9ff3e60d351dfcd0e291eb7391fe9d3332a3
tree0f940c7b71f5e509f8772c6aebc667c9df9fd1dc
parent625162a5188da5dcf1d65afa2307d22f58e0e4cc
HID: LG: validate HID output report details

commit 0fb6bd06e06792469acc15bbe427361b56ada528 upstream.

A HID device could send a malicious output report that would cause the
lg, lg3, and lg4 HID drivers to write beyond the output report allocation
during an event, causing a heap overflow:

[  325.245240] usb 1-1: New USB device found, idVendor=046d, idProduct=c287
...
[  414.518960] BUG kmalloc-4096 (Not tainted): Redzone overwritten

Additionally, while lg2 did correctly validate the report details, it was
cleaned up and shortened.

CVE-2013-2893

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
[PG: drop hid-lg4ff.c chunk; file not present in 2.6.34 baseline.]
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/hid/hid-lg2ff.c
drivers/hid/hid-lg3ff.c
drivers/hid/hid-lgff.c