Linux USB
 help / color / mirror / Atom feed
* [PATCH v2] usb: appledisplay: validate interrupt report length
@ 2026-12-03  3:39 Pengpeng Hou
  2026-12-03  3:42 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Pengpeng Hou @ 2026-12-03  3:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Pengpeng Hou, linux-usb, linux-kernel

A successful interrupt completion does not guarantee that both bytes of
the report were transferred. Resubmit a short URB without interpreting
the buffer as a button event.

Fixes: 069e8a65cd79 ("[PATCH] Driver for Apple Cinema Display")
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
Changes since v1:
Check the actual length before the success comment, as Greg suggested.
Previous version: https://lore.kernel.org/r/20260830142410.37791-1-pengpeng@iscas.ac.cn

Codex assisted with patch preparation and the changelog.
Current review: Codex (Assisted-by: gpt 5).
Static review only; this revision was not built.

 drivers/usb/misc/appledisplay.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
index 16883592f7fc698ae1ca127bfd52204100e7ed97..ed7148d9a22dd9927d72aee12b3e293373e66a93 100644
--- a/drivers/usb/misc/appledisplay.c
+++ b/drivers/usb/misc/appledisplay.c
@@ -81,6 +81,8 @@ static void appledisplay_complete(struct urb *urb)
 
 	switch (status) {
 	case 0:
+		if (urb->actual_length < ACD_URB_BUFFER_LEN)
+			goto exit;
 		/* success */
 		break;
 	case -EOVERFLOW:

base-commit: 693c2e04e3f1d4c59af236e1211b7b8cb165a790


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

* Re: [PATCH v2] usb: appledisplay: validate interrupt report length
  2026-12-03  3:39 [PATCH v2] usb: appledisplay: validate interrupt report length Pengpeng Hou
@ 2026-12-03  3:42 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-12-03  3:42 UTC (permalink / raw)
  To: Pengpeng Hou; +Cc: linux-usb

> A successful interrupt completion does not guarantee that both bytes of
> the report were transferred. Resubmit a short URB without interpreting
> the buffer as a button event.
> 
> Fixes: 069e8a65cd79 ("[PATCH] Driver for Apple Cinema Display")
> Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203033948.60708-1-pengpeng@iscas.ac.cn?part=1

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

end of thread, other threads:[~2026-12-03  3:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  3:39 [PATCH v2] usb: appledisplay: validate interrupt report length Pengpeng Hou
2026-12-03  3:42 ` sashiko-bot

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