mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jiale Yao <yaojiale02@163.com>
To: Stefan Achatz <erazor_de@users.sourceforge.net>,
	Jiri Kosina <jikos@kernel.org>,
	Benjamin Tissoires <bentiss@kernel.org>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Jiale Yao <yaojiale02@163.com>, stable@vger.kernel.org
Subject: [PATCH 1/7] HID: roccat: isku: reject short button reports
Date: Thu, 24 Sep 2026 22:29:11 +0800	[thread overview]
Message-ID: <20260924142918.1177952-2-yaojiale02@163.com> (raw)
In-Reply-To: <20260924142918.1177952-1-yaojiale02@163.com>

The raw event callback runs before HID core validates and zero-pads the
report.  It passes the buffer to helpers which inspect data[0] and, for a
button report, read the complete struct isku_report_button.  A truncated
report can therefore cause an out-of-bounds read.

Require enough data for the button report before calling either helper.
Commit 47669bec44fe ("HID: asus: refactor the two workqueues and init
sequence") added the same kind of raw-event length validation to hid-asus.

Fixes: d41c2a7011df ("HID: roccat: Add support for Isku keyboard")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/hid/hid-roccat-isku.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hid/hid-roccat-isku.c b/drivers/hid/hid-roccat-isku.c
index 93a49c93ae8c..ef1ec9ccaa82 100644
--- a/drivers/hid/hid-roccat-isku.c
+++ b/drivers/hid/hid-roccat-isku.c
@@ -411,6 +411,9 @@ static int isku_raw_event(struct hid_device *hdev,
 	if (isku == NULL)
 		return 0;
 
+	if (size < sizeof(struct isku_report_button))
+		return 0;
+
 	isku_keep_values_up_to_date(isku, data);
 
 	if (isku->roccat_claimed)
-- 
2.34.1


  reply	other threads:[~2026-09-24 14:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 14:29 [PATCH 0/7] HID: roccat: validate raw report lengths Jiale Yao
2026-09-24 14:29 ` Jiale Yao [this message]
2026-09-24 14:29 ` [PATCH 2/7] HID: roccat: koneplus: reject short button reports Jiale Yao
2026-09-24 14:29 ` [PATCH 3/7] HID: roccat: konepure: " Jiale Yao
2026-09-24 14:29 ` [PATCH 4/7] HID: roccat: kovaplus: " Jiale Yao
2026-09-24 14:29 ` [PATCH 5/7] HID: roccat: pyra: " Jiale Yao
2026-09-24 14:29 ` [PATCH 6/7] HID: roccat: ryos: reject short special reports Jiale Yao
2026-09-24 14:29 ` [PATCH 7/7] HID: roccat: savu: " Jiale Yao

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=20260924142918.1177952-2-yaojiale02@163.com \
    --to=yaojiale02@163.com \
    --cc=bentiss@kernel.org \
    --cc=erazor_de@users.sourceforge.net \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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®