qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 9/9] usb: mtp: reply INCOMPLETE_TRANSFER on read


From: Gerd Hoffmann
Subject: Re: [Qemu-devel] [PATCH 9/9] usb: mtp: reply INCOMPLETE_TRANSFER on read errors
Date: Fri, 25 Apr 2014 14:12:13 +0200

  Hi,

> The bogus data packet is sent with usb_packet_copy, shouldn't you return
> USB_RET_NAK for now?

I don't think so.  The transfer must be completed, even if we don't send
valid data, because the guest expects a certain number of data bytes
before the result packet with the status code.  If we don't send them we
are out of sync.

We might memset(d->data, 0, dlen) so the guest gets zeros instead of the
data block from the last successful read.  The guest is supposed to
discard the data though, so it should not be needed.

Ahem, well, realloc doesn't clear memory, so I guess we better _do_
memset, so we don't leak random qemu memory to the guest in case the
very first read call fails.  I'll fix it up.

cheers,
  Gerd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]