]> git.baikalelectronics.ru Git - kernel.git/commit
xen/gntdev: fix unsafe vma access
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Wed, 2 Jan 2013 22:57:11 +0000 (22:57 +0000)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Tue, 15 Jan 2013 21:01:06 +0000 (16:01 -0500)
commitad269201f4dd2d06f977282763da3b3bb6b2169d
tree959938beb9ef789e72217844d159c95604817ac5
parent621854108c1cba3e2d61cd3849a11fef42ddd972
xen/gntdev: fix unsafe vma access

In gntdev_ioctl_get_offset_for_vaddr, we need to hold mmap_sem while
calling find_vma() to avoid potentially having the result freed out from
under us.  Similarly, the MMU notifier functions need to synchronize with
gntdev_vma_close to avoid map->vma being freed during their iteration.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/gntdev.c