[PATCH v2 0/5] HID: wacom: guard against NULL input devices on successful probe

From: Jinmo Yang

Date: Sun Oct 18 2026 - 06:46:31 EST


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 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 (5):
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

drivers/hid/wacom_wac.c | 90 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 87 insertions(+), 3 deletions(-)

--
2.53.0