* [PATCH v2] usb: appledisplay: validate interrupt report length
@ 2026-12-03 3:39 Pengpeng Hou
2026-12-03 16:53 ` Greg Kroah-Hartman
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 [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 16:53 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2026-12-03 16:53 UTC (permalink / raw)
To: Pengpeng Hou; +Cc: linux-usb, linux-kernel
On Thu, Dec 03, 2026 at 11:39:48AM +0800, Pengpeng Hou wrote:
> 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
How was this tested?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 3:22 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 16:53 ` Greg Kroah-Hartman
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®