From: "jiale yao" <19888972804@163.com>
To: "Derek J. Clark" <derekjohn.clark@gmail.com>,
"Jiri Kosina" <jikos@kernel.org>,
"Benjamin Tissoires" <bentiss@kernel.org>,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re:[PATCH] HID: oxp: reject short input reports
Date: Sat, 17 Oct 2026 15:39:05 +0800 (CST) [thread overview]
Message-ID: <2da71486.18d8.1a148ccd3b5.Coremail.19888972804@163.com> (raw)
In-Reply-To: <20261017062347.3787437-1-yaojiale02@163.com>
At 2026-10-17 14:23:47, "Jiale Yao" <yaojiale02@163.com> wrote:
>oxp_hid_raw_event() logs a full OXP packet and then dispatches it to one
>of two parsers. Both parsers access fixed offsets and cast the input to
>fixed-size report structures without checking the received length. A short
>report can therefore be read beyond its valid data.
>
>Reject reports shorter than the fixed OXP packet size before logging or
>dispatching them.
>
Fixes: 84910c459d65 ("HID: hid-oxp: Add OneXPlayer configuration driver")
Fixes: 252c4bf1d931 ("HID: hid-oxp: Add Second Generation RGB Control")
>Signed-off-by: Jiale Yao <yaojiale02@163.com>
>---
> drivers/hid/hid-oxp.c | 3 +++
> 1 file changed, 3 insertions(+)
>
>diff --git a/drivers/hid/hid-oxp.c b/drivers/hid/hid-oxp.c
>index 1e691ebc1199..e1e1b99e9878 100644
>--- a/drivers/hid/hid-oxp.c
>+++ b/drivers/hid/hid-oxp.c
>@@ -435,6 +435,9 @@ static int oxp_hid_raw_event(struct hid_device *hdev, struct hid_report *report,
> {
> u16 up = get_usage_page(hdev);
>
>+ if (size < OXP_PACKET_SIZE)
>+ return 0;
>+
> dev_dbg(&hdev->dev, "raw event data: [%*ph]\n", OXP_PACKET_SIZE, data);
>
> switch (up) {
>--
>2.34.1
prev parent reply other threads:[~2026-10-17 7:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-17 6:23 [PATCH] " Jiale Yao
2026-10-17 7:39 ` jiale yao [this message]
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=2da71486.18d8.1a148ccd3b5.Coremail.19888972804@163.com \
--to=19888972804@163.com \
--cc=bentiss@kernel.org \
--cc=derekjohn.clark@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®