Re: [RFC] vhost/vsock: fix use-after-free in network stack callers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 01, 2018 at 04:43:28PM +0000, Stefan Hajnoczi wrote:
> @@ -580,6 +601,11 @@ static int vhost_vsock_dev_release(struct inode *inode, struct file *file)
>  	list_del(&vsock->list);
>  	spin_unlock_bh(&vhost_vsock_lock);
>  
> +	/* Now that the vsock instance is no longer visible, wait for other
> +	 * CPUs to drop their references.
> +	 */
> +	wait_event(vsock->net_users_wq, refcount_read(&vsock->net_users));

It helps if the condition is correct:

  refcount_read(&vsock->net_users) == 0

:-)

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux