From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Pengpeng Hou <pengpeng@iscas.ac.cn>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] usb: appledisplay: validate interrupt report length
Date: Thu, 3 Dec 2026 17:53:19 +0100 [thread overview]
Message-ID: <2026120350-velvet-definite-db30@gregkh> (raw)
In-Reply-To: <20261203033948.60708-1-pengpeng@iscas.ac.cn>
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
prev parent reply other threads:[~2026-12-04 3:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 3:39 Pengpeng Hou
2026-12-03 16:53 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026120350-velvet-definite-db30@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=pengpeng@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®