From: Benjamin Tissoires <bentiss@kernel.org>
To: Jiri Kosina <jikos@kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
Shuah Khan <shuah@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org,
Benjamin Tissoires <bentiss@kernel.org>,
stable@vger.kernel.org
Subject: [PATCH v2 3/4] HID: core: do not bypass hid_hw_raw_request
Date: Thu, 10 Jul 2025 16:01:35 +0200 [thread overview]
Message-ID: <20250710-report-size-null-v2-3-ccf922b7c4e5@kernel.org> (raw)
In-Reply-To: <20250710-report-size-null-v2-0-ccf922b7c4e5@kernel.org>
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
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
drivers/hid/hid-core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 320887c365f7a36f7376556ffd19f99e52b7d732..b31b8a2fd540bd5ed66599020824726e69d10d75 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;
--
2.49.0
next prev parent reply other threads:[~2025-07-10 14:02 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 14:01 [PATCH v2 0/4] HID: core: fix __hid_request when no report ID is used Benjamin Tissoires
2025-07-10 14:01 ` [PATCH v2 1/4] HID: core: ensure the allocated report buffer can contain the reserved report ID Benjamin Tissoires
2025-07-10 14:01 ` [PATCH v2 2/4] HID: core: ensure __hid_request reserves the report ID as the first byte Benjamin Tissoires
2025-07-10 14:01 ` Benjamin Tissoires [this message]
2025-07-10 14:01 ` [PATCH v2 4/4] selftests/hid: add a test case for the recent syzbot underflow Benjamin Tissoires
2025-07-11 10:52 ` Benjamin Tissoires
2025-07-13 7:44 ` Benjamin Tissoires
2025-07-13 7:54 ` [PATCH v2 0/4] HID: core: fix __hid_request when no report ID is used Benjamin Tissoires
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250710-report-size-null-v2-3-ccf922b7c4e5@kernel.org \
--to=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=stable@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).