diff options
author | Kees Cook <keescook@chromium.org> | 2013-08-28 16:31:44 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2013-09-04 06:01:58 -0400 |
commit | 9e8910257397372633e74b333ef891f20c800ee4 (patch) | |
tree | 3aaf2d19632500e3c45e59fe393600a86dd3434b /drivers/hid | |
parent | 875b4e3763dbc941f15143dd1a18d10bb0be303b (diff) |
HID: sensor-hub: validate feature report details
A HID device could send a malicious feature report that would cause the
sensor-hub HID driver to read past the end of heap allocation, leaking
kernel memory contents to the caller.
CVE-2013-2898
Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: stable@kernel.org
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-sensor-hub.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index ffc80cf481b4..6fca30eb377d 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c | |||
@@ -221,7 +221,8 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | |||
221 | 221 | ||
222 | mutex_lock(&data->mutex); | 222 | mutex_lock(&data->mutex); |
223 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); | 223 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); |
224 | if (!report || (field_index >= report->maxfield)) { | 224 | if (!report || (field_index >= report->maxfield) || |
225 | report->field[field_index]->report_count < 1) { | ||
225 | ret = -EINVAL; | 226 | ret = -EINVAL; |
226 | goto done_proc; | 227 | goto done_proc; |
227 | } | 228 | } |