Linux USB
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Maoyi Xie" <maoyixie.tju@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: [PATCH v2] USB: iowarrior: use kzalloc() for the interrupt-in buffer
Date: Mon, 30 Nov 2026 11:35:35 +0000	[thread overview]
Message-ID: <sashiko-outbox-240962@kernel.org> (raw)
In-Reply-To: <20261130113237.2371847-1-maoyixie.tju@gmail.com>

> iowarrior_callback() copies report_size bytes of the interrupt-in
> buffer into the read queue. It never looks at urb->actual_length. The
> buffer comes from kmalloc(). After a short report the bytes past
> actual_length can be uninitialized. iowarrior_read() copies them to
> user space.
> 
> Allocate the buffer with kzalloc(). A short report is passed on as
> before. It can still carry bytes of an earlier report.
> 
> Found with a CodeQL-based static analysis tool that we are developing.
> Reproduced in a userspace harness and with an emulated device on
> dummy_hcd. Not tested on hardware.
> 
> Fixes: 946b960d13c1 ("USB: add driver for iowarrior devices.")
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: stable@vger.kernel.org
> Signed-off-by: Maoyi Xie <maoyixie.tju@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261130113237.2371847-1-maoyixie.tju@gmail.com?part=1

      reply	other threads:[~2026-11-30 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 11:32 [PATCH v2] USB: iowarrior: use kzalloc() for the interrupt-in buffer Maoyi Xie
2026-11-30 11:35 ` sashiko-bot [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=sashiko-outbox-240962@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=maoyixie.tju@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /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