From: Jinmo Yang <jinmo44.yang@gmail.com>
To: ping.cheng@wacom.com, jason.gerecke@wacom.com, jikos@kernel.org,
bentiss@kernel.org
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Jinmo Yang <jinmo44.yang@gmail.com>
Subject: [PATCH v3 0/6] HID: wacom: guard against NULL input devices on successful probe
Date: Sun, 18 Oct 2026 21:47:49 +0900 [thread overview]
Message-ID: <20261018124755.850888-1-jinmo44.yang@gmail.com> (raw)
In-Reply-To: <20260927041138.4112920-1-jinmo44.yang@gmail.com>
When wacom_setup_{pen,touch,pad}_input_capabilities() returns -ENODEV,
the corresponding input pointer is set to NULL but probe still succeeds.
Subsequent irq handlers dereference those pointers unconditionally,
causing NULL-pointer dereferences reachable from a spoofed HID device.
This series adds per-function NULL guards across all affected handlers.
Changes in v3:
- wacom_dtus_irq(): DTUSX is pen-only (no pad), so the pad_input
requirement now has a type != DTUSX exception, matching the existing
GRAPHIRE exception in wacom_graphire_irq(). Also guards the DTUSPAD
branch for spoofed reports (sashiko-bot).
- New patch 6: guards wacom_24hdt_irq() (also covers WACOM_27QHDT),
wacom_intuos_pro2_bt_touch(), and wacom_bamboo_pad_touch_event(),
which were identified as unguarded during review (sashiko-bot).
Changes in v2:
- Restructured per Jason Gerecke's review: replaced per-branch checks
with per-function checks for dtus_irq, graphire_irq, and the Bamboo
handlers — simpler and matches what each function actually requires.
- wacom_intuos_pad() now returns 1 (not 0) when pad_input is NULL, so
the report is consumed and does not fall through to
wacom_intuos_inout() which would misparse a pad packet as a pen
event (sashiko-bot).
- wacom_intuos_bt_irq() now guards both pen_input and pad_input, since
INTUOS4WL always has both on a single interface.
- Added dev_warn_once at every guard (Jason).
- Dropped the cp2112 patch (Benjamin prefers Dmitry's series).
Tested with uhid across 27 Wacom device types (spoofed bus):
unpatched patched
KASAN crashes 17 0
probe failures 0 0
hidraw nodes 26 26
input registrations 25 25
Jinmo Yang (6):
HID: wacom: check the input device in the shared report helpers
HID: wacom: check the input devices in the legacy irq handlers
HID: wacom: add NULL pad_input guard to wacom_intuos_pad()
HID: wacom: add NULL input guards to wacom_intuos_bt_irq()
HID: wacom: add NULL input guards to Bamboo touch/button handlers
HID: wacom: add NULL touch_input guards to remaining touch handlers
drivers/hid/wacom_wac.c | 111 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 108 insertions(+), 3 deletions(-)
base-commit: f5f84daefcd92d7a630066635ecea1433ed5eac7
--
2.53.0
next prev parent reply other threads:[~2026-10-18 12:48 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-23 15:01 [PATCH] HID: wacom: fix NULL pointer dereference in wacom_intuos_pad() Jinmo Yang
2026-05-23 15:06 ` [PATCH v2] " Jinmo Yang
2026-05-29 21:44 ` Dmitry Torokhov
2026-06-10 15:48 ` Jiri Kosina
2026-09-26 18:37 ` Jinmo Yang
2026-09-27 4:11 ` [PATCH 0/5] HID: wacom: check input devices in the report handlers Jinmo Yang
2026-09-27 4:11 ` [PATCH 1/5] HID: wacom: check the input device in the shared report helpers Jinmo Yang
2026-10-17 0:05 ` Jason Gerecke
2026-09-27 4:11 ` [PATCH 2/5] HID: wacom: check the input devices in the legacy irq handlers Jinmo Yang
2026-10-17 0:05 ` Jason Gerecke
2026-09-27 4:11 ` [PATCH 3/5] HID: wacom: check the input device in wacom_intuos_pad() Jinmo Yang
2026-10-17 0:05 ` Jason Gerecke
2026-09-27 4:11 ` [PATCH 4/5] HID: wacom: check the input device in wacom_intuos_bt_irq() Jinmo Yang
2026-10-17 0:05 ` Jason Gerecke
2026-09-27 4:11 ` [PATCH 5/5] HID: wacom: check the input devices in the Bamboo handlers Jinmo Yang
2026-10-17 0:05 ` Jason Gerecke
2026-10-16 9:27 ` [PATCH 0/5] HID: wacom: check input devices in the report handlers Jiri Kosina
2026-10-17 0:05 ` Jason Gerecke
2026-10-18 10:46 ` [PATCH v2 0/5] HID: wacom: guard against NULL input devices on successful probe Jinmo Yang
2026-10-18 10:46 ` [PATCH v2 1/5] HID: wacom: check the input device in the shared report helpers Jinmo Yang
2026-10-18 10:46 ` [PATCH v2 2/5] HID: wacom: check the input devices in the legacy irq handlers Jinmo Yang
2026-10-18 10:46 ` [PATCH v2 3/5] HID: wacom: add NULL pad_input guard to wacom_intuos_pad() Jinmo Yang
2026-10-18 10:46 ` [PATCH v2 4/5] HID: wacom: add NULL input guards to wacom_intuos_bt_irq() Jinmo Yang
2026-10-18 10:46 ` [PATCH v2 5/5] HID: wacom: add NULL input guards to Bamboo touch/button handlers Jinmo Yang
2026-10-18 12:47 ` Jinmo Yang [this message]
2026-10-18 12:47 ` [PATCH v3 1/6] HID: wacom: check the input device in the shared report helpers Jinmo Yang
2026-10-18 12:47 ` [PATCH v3 2/6] HID: wacom: check the input devices in the legacy irq handlers Jinmo Yang
2026-10-18 12:47 ` [PATCH v3 3/6] HID: wacom: add NULL pad_input guard to wacom_intuos_pad() Jinmo Yang
2026-10-18 12:47 ` [PATCH v3 4/6] HID: wacom: add NULL input guards to wacom_intuos_bt_irq() Jinmo Yang
2026-10-18 12:47 ` [PATCH v3 5/6] HID: wacom: add NULL input guards to Bamboo touch/button handlers Jinmo Yang
2026-10-18 12:47 ` [PATCH v3 6/6] HID: wacom: add NULL touch_input guards to remaining touch handlers Jinmo Yang
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=20261018124755.850888-1-jinmo44.yang@gmail.com \
--to=jinmo44.yang@gmail.com \
--cc=bentiss@kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=jason.gerecke@wacom.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ping.cheng@wacom.com \
--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®