Re: [virtio-dev] [PATCH RFC 3/3] rng: leak detection support
Babis Chalios <[email protected]>
| Newsgroups | dev.linux.lists.virtio-dev |
|---|---|
| Message-ID | <[email protected]> |
>> yes, the queue switch is used as a barrier to detect a new leak event. > > Right, so I think that there is a race condition between the time the > driver sees the used buffers of the first > batch and until it adds the second batch on the next leak queue. > > 1. driver adds batch 1 > 2. leak event > 3. device uses batch 1 > 4. driver sees the used buffers and > a. switches leak queues > b. adds batch 2. > 5. devices finds initial leak queue empty and sees buffers in second > leak queue. > > If a second leak event happens after step 3 above and before all of > steps 4 complete then batch 2 will not > be processed as part of the second leak event. > Hey Michael, any thoughts on this? I think the my Linux RFC patch[1] showcases the problem in the `entropy_leak_detected` function which handles the used buffers. If on the VMM we receive a new leak event before `entropy_leak_detected` runs to completion (and adds a new batch of buffers) the leak event will not have any buffers to handle. [1] https://lore.kernel.org/lkml/[email protected]/T/#m085769c7b9c08f4acac626e7b4ecde11af13a5be Cheers, Babis --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]