Patch "HID: i2c-hid: allocate hid buffers for real worst case" has been added to the 4.4-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
HID: i2c-hid: allocate hid buffers for real worst case
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
hid-i2c-hid-allocate-hid-buffers-for-real-worst-case.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
8320caeeffdefec3b58b9d4a7ed8e1079492fe7bMon Sep 17 00:00:00 2001
From: Adrian Salido <[email protected]>
Date: Fri, 8 Sep 2017 10:55:27 -0700
Subject: HID: i2c-hid: allocate hid buffers for real worst case
From: Adrian Salido <[email protected]>
commit 8320caeeffdefec3b58b9d4a7ed8e1079492fe7b upstream.
The buffer allocation is not currently accounting for an extra byte for the report id. This can cause an out of bounds access in function i2c_hid_set_or_send_report() with reportID > 15.
--- drivers/hid/i2c-hid/i2c-hid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid.c +2 -1
@@ -540,7 +540,8 @@ static int i2c_hid_alloc_buffers(struct {/* the worst case is computed from the set_report command with a * reportID > 15 and the maximum report length */ -int args_len =sizeof (__u8) +/* optional ReportID byte */ +int args_len =sizeof (__u8) +/* ReportID */ +sizeof (__u8) +/* optional ReportID byte */ sizeof (__u16) +/* data register */ sizeof (__u16) +/* size of the report */ report_size;/* report */
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/hid-i2c-hid-allocate-hid-buffers-for-real-worst-case.patch