Thread (5 messages) 5 messages, 2 authors, 2020-08-11

Re: [PATCH v2] virtio-rng: return available data with O_NONBLOCK

From: "Michael S. Tsirkin" <mst@redhat.com>
Date: 2020-08-11 13:14:59
Also in: qemu-devel

On Tue, Aug 11, 2020 at 03:00:14PM +0200, Laurent Vivier wrote:
No problem. This code is tricky and it took me several months to really
start to understand it ...
Oh great, we actually have someone who understands the code!
Maybe you can help me understand: virtio_read
takes the buf pointer and puts it in the vq.
It can then return to caller (e.g. on a signal).
Device can meanwhile write into the buffer.

It looks like if another call then happens, and that
other call uses a different buffer, virtio rng
will happily return the data written into the
original buf pointer, confusing the caller.

Is that right?

-- 
MST

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help