All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luigi Leonardi <leonardi@redhat.com>
To: Tommaso Califano <tcalifano@redhat.com>
Cc: qemu-devel@nongnu.org,
	"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v2] hw/usb/dev-mtp: Fix assert crash on short CMD_SEND_OBJECT
Date: Thu, 8 Oct 2026 14:38:23 +0200	[thread overview]
Message-ID: <aseOsAfB3GuyghJF@leonardi-redhat> (raw)
In-Reply-To: <20261008122936.45081-1-tcalifano@redhat.com>

On Thu, Oct 08, 2026 at 02:29:36PM +0200, Tommaso Califano wrote:
>In usb_mtp_get_data() there is a guest-triggerable assertion that fires
>when a guest declares a large object size in CMD_SEND_OBJECT_INFO but
>sends fewer bytes in the subsequent CMD_SEND_OBJECT. The assertion
>compares the declared size against the actual bytes received.
>
>If the guest sends CMD_SEND_OBJECT_INFO with size=1000 and then
>CMD_SEND_OBJECT with only 50 bytes (short, non-64-byte-aligned
>final USB packet) the assertion fires, killing QEMU.
>
>To prevent that is sufficient to remove the assertion, because the case
>is handled by usb_mtp_write_data() which returns RES_INCOMPLETE_TRANSFER.
>
>Fixes: 3e096650a64d ("dev-mtp: Add support for > 4GB file transfers")
>Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3993
>Signed-off-by: Tommaso Califano <tcalifano@redhat.com>

Reviewed-by: Luigi Leonardi <leonardi@redhat.com>



  parent reply	other threads:[~2026-10-08 12:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08 12:29 [PATCH v2] hw/usb/dev-mtp: Fix assert crash on short CMD_SEND_OBJECT Tommaso Califano
2026-10-08 12:35 ` Marc-André Lureau
2026-10-08 12:38 ` Luigi Leonardi [this message]
2026-10-08 20:45 ` Philippe Mathieu-Daudé

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=aseOsAfB3GuyghJF@leonardi-redhat \
    --to=leonardi@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=tcalifano@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.