]> git.baikalelectronics.ru Git - kernel.git/commit
xen/gntdev: avoid out of bounds access in case of partial gntdev_mmap()
authorJuergen Gross <jgross@suse.com>
Wed, 25 Oct 2017 15:08:07 +0000 (17:08 +0200)
committerBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 25 Oct 2017 16:48:13 +0000 (12:48 -0400)
commit0886d10f4f955b08ca1b2fb4f8e11cf7200c21da
tree4337329fdc85462328edb08a35f6c373c82ab6f1
parentfa1a458466e6eed93d3c06669e18b576294470d7
xen/gntdev: avoid out of bounds access in case of partial gntdev_mmap()

In case gntdev_mmap() succeeds only partially in mapping grant pages
it will leave some vital information uninitialized needed later for
cleanup. This will lead to an out of bounds array access when unmapping
the already mapped pages.

So just initialize the data needed for unmapping the pages a little bit
earlier.

Cc: <stable@vger.kernel.org>
Reported-by: Arthur Borsboom <arthurborsboom@gmail.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
drivers/xen/gntdev.c