Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: Prevent NULL dereference in wireless work
@ 2026-10-30 17:31 Devarjya Purkayastha
  2026-10-30 17:45 ` sashiko-bot
  2026-10-30 20:43 ` Jason Gerecke
  0 siblings, 2 replies; 3+ messages in thread
From: Devarjya Purkayastha @ 2026-10-30 17:31 UTC (permalink / raw)
  To: linux-input
  Cc: ping.cheng, jason.gerecke, jikos, bentiss, linux-kernel,
	Devarjya Purkayastha, Indrath

wacom_wireless_work() assumes that the active USB configuration has
three interfaces and unconditionally accesses interface[1] and
interface[2].

A malformed configuration with fewer interfaces can therefore cause a
NULL pointer dereference in the wireless workqueue. Return early unless
the configuration has at least three interfaces.

Reported-by: Indrath <indrathftw@gmail.com>
Signed-off-by: Devarjya Purkayastha <unseentactician27062006@gmail.com>
---
 drivers/hid/wacom_sys.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 628372ab818a..dcf2811a5c48 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -2619,7 +2619,7 @@ static void wacom_wireless_work(struct work_struct *work)
 
 	wacom_destroy_battery(wacom);
 
-	if (!usbdev)
+	if (!usbdev || usbdev->config->desc.bNumInterfaces < 3)
 		return;
 
 	/* Stylus interface */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-30 20:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 17:31 [PATCH] HID: wacom: Prevent NULL dereference in wireless work Devarjya Purkayastha
2026-10-30 17:45 ` sashiko-bot
2026-10-30 20:43 ` Jason Gerecke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox