diff options
author | Kees Cook <keescook@chromium.org> | 2013-08-28 16:30:49 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-09-04 05:58:32 -0400 |
commit | 412f30105ec6735224535791eed5cdc02888ecb4 (patch) | |
tree | 217da936ca3f5afd4327c664dcb5b2d6f7722dec /drivers/hid/hid-pl.c | |
parent | 8c89cc17b91992845bd635813cd162fe8dfcec6e (diff) |
HID: pantherlord: validate output report details
A HID device could send a malicious output report that would cause the
pantherlord HID driver to write beyond the output report allocation
during initialization, causing a heap overflow:
[ 310.939483] usb 1-1: New USB device found, idVendor=0e8f, idProduct=0003
...
[ 315.980774] BUG kmalloc-192 (Tainted: G W ): Redzone overwritten
CVE-2013-2892
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-pl.c')
-rw-r--r-- | drivers/hid/hid-pl.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c index d29112fa5cd5..2dcd7d98dbd6 100644 --- a/drivers/hid/hid-pl.c +++ b/drivers/hid/hid-pl.c | |||
@@ -132,8 +132,14 @@ static int plff_init(struct hid_device *hid) | |||
132 | strong = &report->field[0]->value[2]; | 132 | strong = &report->field[0]->value[2]; |
133 | weak = &report->field[0]->value[3]; | 133 | weak = &report->field[0]->value[3]; |
134 | debug("detected single-field device"); | 134 | debug("detected single-field device"); |
135 | } else if (report->maxfield >= 4 && report->field[0]->maxusage == 1 && | 135 | } else if (report->field[0]->maxusage == 1 && |
136 | report->field[0]->usage[0].hid == (HID_UP_LED | 0x43)) { | 136 | report->field[0]->usage[0].hid == |
137 | (HID_UP_LED | 0x43) && | ||
138 | report->maxfield >= 4 && | ||
139 | report->field[0]->report_count >= 1 && | ||
140 | report->field[1]->report_count >= 1 && | ||
141 | report->field[2]->report_count >= 1 && | ||
142 | report->field[3]->report_count >= 1) { | ||
137 | report->field[0]->value[0] = 0x00; | 143 | report->field[0]->value[0] = 0x00; |
138 | report->field[1]->value[0] = 0x00; | 144 | report->field[1]->value[0] = 0x00; |
139 | strong = &report->field[2]->value[0]; | 145 | strong = &report->field[2]->value[0]; |