[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <000000000000d309be061e7f099c@google.com>
Date: Tue, 30 Jul 2024 16:07:14 -0700
From: syzbot <syzbot+24c0361074799d02c452@...kaller.appspotmail.com>
To: linux-kernel@...r.kernel.org
Subject: Re: [syzbot] [PATCH] usb: fix slab-out-of-bounds Read in cougar_report_fixup
For archival purposes, forwarding an incoming command email to
linux-kernel@...r.kernel.org.
***
Subject: [PATCH] usb: fix slab-out-of-bounds Read in cougar_report_fixup
Author: cam.alvarez.i@...il.com
#syz test
report_fixup for the Cougar 500k Gaming Keyboard was not verifying
that the report descriptor size was correct before accessing it
Signed-off-by: Camila Alvarez <cam.alvarez.i@...il.com>
---
drivers/hid/hid-cougar.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-cougar.c b/drivers/hid/hid-cougar.c
index cb8bd8aae15b..0fa785f52707 100644
--- a/drivers/hid/hid-cougar.c
+++ b/drivers/hid/hid-cougar.c
@@ -106,7 +106,7 @@ static void cougar_fix_g6_mapping(void)
static __u8 *cougar_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
- if (rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
+ if (*rsize >= 117 && rdesc[2] == 0x09 && rdesc[3] == 0x02 &&
(rdesc[115] | rdesc[116] << 8) >= HID_MAX_USAGES) {
hid_info(hdev,
"usage count exceeds max: fixing up report descriptor\n");
--
2.34.1
Powered by blists - more mailing lists