xen/gntdevt: Fix race condition in gntdev_release()
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Fri, 26 Jun 2015 01:28:24 +0000 (03:28 +0200)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:09:44 +0000 (13:09 +0000)
commit9ae298345acf43f2e7c1ae4f334cdc19eda415e5
treeaccffe27bc91a1dc4f4ca184052fc7991f73d896
parent777755e3387da03e9671d7ec2d1966999a83da27
xen/gntdevt: Fix race condition in gntdev_release()

commit 30b03d05e07467b8c6ec683ea96b5bffcbcd3931 upstream.

While gntdev_release() is called the MMU notifier is still registered
and can traverse priv->maps list even if no pages are mapped (which is
the case -- gntdev_release() is called after all). But
gntdev_release() will clear that list, so make sure that only one of
those things happens at the same time.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/gntdev.c