UPSTREAM: hwrng: virtio - add an internal buffer
hwrng core uses two buffers that can be mixed in the virtio-rng queue. If the buffer is provided with wait=0 it is enqueued in the virtio-rng queue but unused by the caller. On the next call, core provides another buffer but the first one is filled instead and the new one queued. And the caller reads the data from the new one that is not updated, and the data in the first one are lost. To avoid this mix, virtio-rng needs to use its own unique internal buffer at a cost of a data copy to the caller buffer. Signed-off-by:Laurent Vivier <lvivier@redhat.com> Link: https://lore.kernel.org/r/20211028101111.128049-2-lvivier@redhat.com Signed-off-by:
Michael S. Tsirkin <mst@redhat.com> (cherry picked from commit bf3175bc50a3754dc427e2f5046e17a9fafc8be7) Bug: 249566340 Change-Id: Ica2fd680de4bb359923b94dae48c00f6207a6876 Signed-off-by:
Alistair Delva <adelva@google.com>
Loading
Please register or sign in to comment