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:
> Here's the refcount approach to avoiding struct vhost_vsock
> use-after-free.  On the plus side it allows multiple CPUs to run
> .send_pkt()/.cancel_pkt() instead of the previous locking solution.  On
> the other hand, it results in a useless waitqueue wake_up() on most
> .send_pkt()/.cancel_pkt() calls (which involves a waitqueue spinlock).

I figured out an easy way to avoid wake_up() during normal operation:
hold a refcount until .release().  That way the data path never calls
wake_up() until .release() time.

Now I'm happier with my refcount approach.

Stefan

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