Skip to content

Commit acf9736

Browse files
committed
Merge: CVE-2024-57993: HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6469 JIRA: https://issues.redhat.com/browse/RHEL-81416 CVE: CVE-2024-57993 ``` commit 50420d7 Author: Karol Przybylski <karprzy7@gmail.com> Date: Thu Dec 5 23:22:21 2024 +0100 HID: hid-thrustmaster: Fix warning in thrustmaster_probe by adding endpoint check syzbot has found a type mismatch between a USB pipe and the transfer endpoint, which is triggered by the hid-thrustmaster driver[1]. There is a number of similar, already fixed issues [2]. In this case as in others, implementing check for endpoint type fixes the issue. [1] https://syzkaller.appspot.com/bug?extid=040e8b3db6a96908d470 [2] https://syzkaller.appspot.com/bug?extid=348331f63b034f89b622 Fixes: c49c336 ("HID: support for initialization of some Thrustmaster wheels") Reported-by: syzbot+040e8b3db6a96908d470@syzkaller.appspotmail.com Tested-by: syzbot+040e8b3db6a96908d470@syzkaller.appspotmail.com Signed-off-by: Karol Przybylski <karprzy7@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.com> ``` Signed-off-by: CKI Backport Bot <cki-ci-bot+cki-gitlab-backport-bot@redhat.com> --- <small>Created 2025-02-27 20:43 UTC by backporter - [KWF FAQ](https://red.ht/kernel_workflow_doc) - [Slack #team-kernel-workflow](https://redhat-internal.slack.com/archives/C04LRUPMJQ5) - [Source](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/webhook/utils/backporter.py) - [Documentation](https://gitlab.com/cki-project/kernel-workflow/-/blob/main/docs/README.backporter.md) - [Report an issue](https://gitlab.com/cki-project/kernel-workflow/-/issues/new?issue%5Btitle%5D=backporter%20webhook%20issue)</small> Approved-by: Jarod Wilson <jarod@redhat.com> Approved-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents f11d75e + 4b8e089 commit acf9736

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/hid/hid-thrustmaster.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
170170
ep = &usbif->cur_altsetting->endpoint[1];
171171
b_ep = ep->desc.bEndpointAddress;
172172

173+
/* Are the expected endpoints present? */
174+
u8 ep_addr[2] = {b_ep, 0};
175+
176+
if (!usb_check_int_endpoints(usbif, ep_addr)) {
177+
kfree(send_buf);
178+
hid_err(hdev, "Unexpected non-int endpoint\n");
179+
return;
180+
}
181+
173182
for (i = 0; i < ARRAY_SIZE(setup_arr); ++i) {
174183
memcpy(send_buf, setup_arr[i], setup_arr_sizes[i]);
175184

0 commit comments

Comments
 (0)