[lkml]   [2014]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH net v2] vhost: fix a theoretical race in device cleanup
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 critical section, and synchronize
> on release.
> Since callbacks are always invoked from bh, synchronize_rcu_bh seems
> enough and will help release complete a bit faster.
> Signed-off-by: Michael S. Tsirkin <>
> ---
> This is was previously posted as part of patch
> series, but it's an independent fix really.
> Theoretical race so not needed for stable I think.

Ok, no -stable, applied.

 \ /
  Last update: 2014-02-14 01:21    [W:0.035 / U:4.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site