diff options
author | Benjamin Tissoires <bentiss@kernel.org> | 2025-07-10 17:01:35 +0300 |
---|---|---|
committer | Benjamin Tissoires <bentiss@kernel.org> | 2025-07-13 10:53:27 +0300 |
commit | c2ca42f190b6714d6c481dfd3d9b62ea091c946b (patch) | |
tree | 0d15833871e4d3552a079fd8f35446bbd0ead90d | |
parent | 0d0777ccaa2d46609d05b66ba0096802a2746193 (diff) | |
download | linux-c2ca42f190b6714d6c481dfd3d9b62ea091c946b.tar.xz |
HID: core: do not bypass hid_hw_raw_request
hid_hw_raw_request() is actually useful to ensure the provided buffer
and length are valid. Directly calling in the low level transport driver
function bypassed those checks and allowed invalid paramto be used.
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Closes: https://lore.kernel.org/linux-input/c75433e0-9b47-4072-bbe8-b1d14ea97b13@rowland.harvard.edu/
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20250710-report-size-null-v2-3-ccf922b7c4e5@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
-rw-r--r-- | drivers/hid/hid-core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 320887c365f7..b31b8a2fd540 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1996,8 +1996,7 @@ int __hid_request(struct hid_device *hid, struct hid_report *report, if (reqtype == HID_REQ_SET_REPORT) hid_output_report(report, data_buf); - ret = hid->ll_driver->raw_request(hid, report->id, buf, len, - report->type, reqtype); + ret = hid_hw_raw_request(hid, report->id, buf, len, report->type, reqtype); if (ret < 0) { dbg_hid("unable to complete request: %d\n", ret); goto out; |