From: Jinmo Yang <jinmo44.yang@gmail.com>
To: linux-input@vger.kernel.org
Cc: jikos@kernel.org, benjamin.tissoires@redhat.com,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Jinmo Yang <jinmo44.yang@gmail.com>
Subject: [PATCH 4/4] HID: wacom: validate report length for 24HDT and 27QHDT handlers
Date: Sun, 17 May 2026 22:52:15 +0900 [thread overview]
Message-ID: <20260517135215.2220117-5-jinmo44.yang@gmail.com> (raw)
In-Reply-To: <20260517135215.2220117-1-jinmo44.yang@gmail.com>
wacom_24hdt_irq() accesses data[61] for WACOM_24HDT and data[63] for
WACOM_27QHDT in the raw HID report buffer without validating the buffer
length. This sub-function is called from wacom_wac_irq() which receives
the length parameter but does not pass it to the handler.
A malicious USB device can declare a small HID report in its descriptor
and send a matching short report that passes the HID core size check
(csize >= rsize), but the driver assumes a full-size hardware report
layout, leading to slab-out-of-bounds reads.
Add minimum length checks in wacom_wac_irq() before dispatching to
wacom_24hdt_irq() for both device types.
Fixes: b1e4279e4ef5 ("Input: wacom - add touch sensor support for Cintiq 24HD touch")
Cc: stable@vger.kernel.org
Signed-off-by: Jinmo Yang <jinmo44.yang@gmail.com>
---
drivers/hid/wacom_wac.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 269e8318f..2fd1c4e80 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -3509,7 +3509,14 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len)
break;
case WACOM_24HDT:
+ if (len < 62)
+ return;
+ sync = wacom_24hdt_irq(wacom_wac);
+ break;
+
case WACOM_27QHDT:
+ if (len < 64)
+ return;
sync = wacom_24hdt_irq(wacom_wac);
break;
--
2.53.0
next prev parent reply other threads:[~2026-05-17 13:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-17 13:52 [PATCH 0/4] HID: wacom: add report length validation in irq handlers Jinmo Yang
2026-05-17 13:52 ` [PATCH 1/4] HID: wacom: validate report length for PL and PTU handlers Jinmo Yang
2026-05-17 14:22 ` sashiko-bot
2026-05-17 13:52 ` [PATCH 2/4] HID: wacom: validate report length for DTU handler Jinmo Yang
2026-05-17 14:47 ` sashiko-bot
2026-05-17 13:52 ` [PATCH 3/4] HID: wacom: validate report length for DTUS handler Jinmo Yang
2026-05-17 15:19 ` sashiko-bot
2026-05-17 13:52 ` Jinmo Yang [this message]
2026-05-17 15:45 ` [PATCH 4/4] HID: wacom: validate report length for 24HDT and 27QHDT handlers sashiko-bot
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=20260517135215.2220117-5-jinmo44.yang@gmail.com \
--to=jinmo44.yang@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--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