UPSTREAM: HID: wacom: fix out-of-bounds read in wacom_intuos_bt_irq
[ Upstream commit 2f1763f62909ccb6386ac50350fa0abbf5bb16a9 ]
The wacom_intuos_bt_irq() function processes Bluetooth HID reports
without sufficient bounds checking. A maliciously crafted short report
can trigger an out-of-bounds read when copying data into the wacom
structure.
Specifically, report 0x03 requires at least 22 bytes to safely read
the processed data and battery status, while report 0x04 (which
falls through to 0x03) requires 32 bytes.
Add explicit length checks for these report IDs and log a warning if
a short report is received.
Bug: 514665997
Signed-off-by: Benoît Sevens <[email protected]>
Reviewed-by: Jason Gerecke <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
(cherry picked from commit c8dc23c97680eebefde06da5858aaef1b37cf75d)
Signed-off-by: Lee Jones <[email protected]>
Change-Id: I397583432ec97e3334db55bc103cb8dfbf2431ed
1 file changed