mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: reject short input reports
@ 2026-10-17  6:19 Jiale Yao
  2026-10-17  7:38 ` jiale yao
  0 siblings, 1 reply; 3+ messages in thread
From: Jiale Yao @ 2026-10-17  6:19 UTC (permalink / raw)
  To: Ping Cheng, Jason Gerecke, Jiri Kosina, Benjamin Tissoires,
	linux-input, linux-kernel
  Cc: Jiale Yao

wacom_raw_event() passes incoming reports to the pen serial extractor and
the device-specific IRQ parsers before the HID core validates the declared
report length. A short report can therefore make either consumer read past
the valid input data.

Require the complete report described by the HID report descriptor before
invoking either parser.

Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
 drivers/hid/wacom_sys.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 40770affdbde..85e966e80012 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -175,6 +175,9 @@ static int wacom_raw_event(struct hid_device *hdev, struct hid_report *report,
 	if (wacom->wacom_wac.features.type == BOOTLOADER)
 		return 0;
 
+	if (size < hid_report_len(report))
+		return 0;
+
 	if (wacom_wac_pen_serial_enforce(hdev, report, raw_data, size))
 		return -1;
 
-- 
2.34.1


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

end of thread, other threads:[~2026-10-22 16:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-17  6:19 [PATCH] HID: wacom: reject short input reports Jiale Yao
2026-10-17  7:38 ` jiale yao
2026-10-22 16:14   ` [PATCH] " Jason Gerecke

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®