diff options
author | Johan Korsnes <jkorsnes@cisco.com> | 2020-01-17 13:08:35 +0100 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2020-02-12 14:18:33 +0100 |
commit | 5ebdffd25098898aff1249ae2f7dbfddd76d8f8f (patch) | |
tree | 3122478a9f65b327ac83bd0cf911951719f0ca5f /drivers/hid/usbhid/hiddev.c | |
parent | e433be929e63265b7412478eb7ff271467aee2d7 (diff) |
HID: core: fix off-by-one memset in hid_report_raw_event()
In case a report is greater than HID_MAX_BUFFER_SIZE, it is truncated,
but the report-number byte is not correctly handled. This results in a
off-by-one in the following memset, causing a kernel Oops and ensuing
system crash.
Note: With commit 8ec321e96e05 ("HID: Fix slab-out-of-bounds read in
hid_field_extract") I no longer hit the kernel Oops as we instead fail
"controlled" at probe if there is a report too long in the HID
report-descriptor. hid_report_raw_event() is an exported symbol, so
presumabely we cannot always rely on this being the case.
Fixes: 966922f26c7f ("HID: fix a crash in hid_report_raw_event()
function.")
Signed-off-by: Johan Korsnes <jkorsnes@cisco.com>
Cc: Armando Visconti <armando.visconti@st.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/usbhid/hiddev.c')
0 files changed, 0 insertions, 0 deletions