mirror of
				https://passt.top/passt
				synced 2025-10-26 00:59:13 +02:00 
			
		
		
		
	vhost_user: Clear ring address on GET_VRING_BASE
GET_VRING_BASE stops the queue, clearing the call and kick fds. However, we don't clear vring.avail. That means that if vu_queue_notify() is called it won't realise the queue isn't ready and will die with an EBADFD. We get this during migration, because for some reason, qemu reconfigures the vhost-user device when a migration is triggered. There's a window between the GET_VRING_BASE and re-establishing the call fd where the notify function can be called, causing a crash. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
This commit is contained in:
		
					parent
					
						
							
								71249ef3f9
							
						
					
				
			
			
				commit
				
					
						7c33b12086
					
				
			
		
					 1 changed files with 1 additions and 0 deletions
				
			
		|  | @ -732,6 +732,7 @@ static bool vu_get_vring_base_exec(struct vu_dev *vdev, | ||||||
| 	msg->hdr.size = sizeof(msg->payload.state); | 	msg->hdr.size = sizeof(msg->payload.state); | ||||||
| 
 | 
 | ||||||
| 	vdev->vq[idx].started = false; | 	vdev->vq[idx].started = false; | ||||||
|  | 	vdev->vq[idx].vring.avail = 0; | ||||||
| 
 | 
 | ||||||
| 	if (vdev->vq[idx].call_fd != -1) { | 	if (vdev->vq[idx].call_fd != -1) { | ||||||
| 		close(vdev->vq[idx].call_fd); | 		close(vdev->vq[idx].call_fd); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 David Gibson
				David Gibson