qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.


From: Michael S. Tsirkin
Subject: Re: [Qemu-devel] [PATCH 0/2] virtio len fixes for qemu.
Date: Thu, 12 Mar 2015 07:35:33 +0100

On Thu, Mar 12, 2015 at 11:34:35AM +1030, Rusty Russell wrote:
> "Michael S. Tsirkin" <address@hidden> writes:
> > On Wed, Mar 11, 2015 at 10:06:40PM +1030, Rusty Russell wrote:
> >>         Each entry in the ring is a pair: \field{id} indicates the head
> >>         entry of the descriptor chain describing the buffer (this
> >>         matches an entry placed in the available ring by the guest
> >>         earlier), and \field{len} the total of bytes written into the
> >>         buffer. The latter is extremely useful for drivers using
> >>         untrusted buffers: if you do not know exactly how much has been
> >>         written by the device, you usually have to zero the buffer to
> >>         ensure no data leakage occurs.
> >
> > Right so what does this "if you do not know exactly how much has been
> > written by the device" mean?
> 
> It means "without this feature, you would not know how much has been
> written by the device"...

So imagine a situation where device does not know for sure
how much was written, like here.
Should it set len to value that was written for sure?
Or to value that was possibly written?


Also, e.g. RX in virtio net really depends on len for correctness,
not just as an optimization like the above text implies.


Looks like we need to define it specifically, per device.


> Should probably become a Note:
> 
> Cheers,
> Rusty.



reply via email to

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