Re: [PATCH net v2] vhost: fix a theoretical race in device cleanup

2014-02-13 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 13 Feb 2014 11:45:11 +0200 > vhost_zerocopy_callback accesses VQ right after it drops a ubuf > reference. In theory, this could race with device removal which waits > on the ubuf kref, and crash on use after free. > > Do all accesses within rcu read side cr

Re: [virtio-dev] [PATCH net v2] vhost: fix a theoretical race in device cleanup

2014-02-13 Thread Jason Wang
On 02/13/2014 05:45 PM, Michael S. Tsirkin wrote: > vhost_zerocopy_callback accesses VQ right after it drops a ubuf > reference. In theory, this could race with device removal which waits > on the ubuf kref, and crash on use after free. > > Do all accesses within rcu read side critical section, an

[PATCH net v2] vhost: fix a theoretical race in device cleanup

2014-02-13 Thread Michael S. Tsirkin
vhost_zerocopy_callback accesses VQ right after it drops a ubuf reference. In theory, this could race with device removal which waits on the ubuf kref, and crash on use after free. Do all accesses within rcu read side critical section, and synchronize on release. Since callbacks are always invok