Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virtio(4): change members of struct vring_desc_extra before free a slot
This prevents the following race condition. 1. Thread-A: calls virtio_dequeue_commit() and puts a slot into free descriptor chain in vq_free_slot() 2. Thread-B: calls virtio_enqueue_prep() and get the slot stored by Thread-A 3. Thread-B: calls virtio_enqueue_reserve() and changes desc_base and desc_free_idx for the slot 4. Thread-A: changes the same members updated by Thread-B reported by hannken, thanks.
- Loading branch information