Linux USB
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Maoyi Xie <maoyixie.tju@gmail.com>
Cc: linux-usb@vger.kernel.org, Christoph Jung <jung@codemercs.com>
Subject: Re: [PATCH] USB: iowarrior: ignore short reports
Date: Sun, 29 Nov 2026 14:54:15 +0100	[thread overview]
Message-ID: <2026112925-skipping-ditto-bada@gregkh> (raw)
In-Reply-To: <20261128084355.721820-1-maoyixie.tju@gmail.com>

On Sat, Nov 28, 2026 at 04:43:55PM +0800, Maoyi Xie wrote:
> iowarrior_callback() copies report_size bytes of the interrupt-in
> buffer into the read queue. It never looks at urb->actual_length. After
> a short report the bytes past actual_length are stale or uninitialized.
> iowarrior_read() copies them to user space.
> 
> The vendor's datasheets describe only reports of a fixed length. Ignore
> a report shorter than report_size.

To be safe, as you don't have the hardware, why not just make sure the
buffer is set to 0 so if anything "leaks" it's not actual junk?  We've
seen patches like this break things because drivers assume that they can
handle these types of "errors" just fine.

thanks,

greg k-h

      parent reply	other threads:[~2026-11-29 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  8:43 [PATCH] USB: iowarrior: ignore short reports Maoyi Xie
2026-11-28  8:46 ` sashiko-bot
2026-11-29 13:54 ` 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=2026112925-skipping-ditto-bada@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=jung@codemercs.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=maoyixie.tju@gmail.com \
    /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