xen/gntdev: Fix dmabuf import with non-zero sgt offset
authorOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Thu, 13 Aug 2020 06:21:09 +0000 (09:21 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:19 +0000 (08:24 +0200)
commitca37f26b27faca9bd66402cd610808c7d1b57969
treee73fbf1cb857390b8c4f18db441de796e18b2d90
parentbdea0200336fcacf4e220275c826fe9fd66bc3e9
xen/gntdev: Fix dmabuf import with non-zero sgt offset

commit 5fa4e6f1c2d8c9a4e47e1931b42893172d388f2b upstream.

It is possible that the scatter-gather table during dmabuf import has
non-zero offset of the data, but user-space doesn't expect that.
Fix this by failing the import, so user-space doesn't access wrong data.

Fixes: bf8dc55b1358 ("xen/gntdev: Implement dma-buf import functionality")

Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Acked-by: Juergen Gross <jgross@suse.com>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20200813062113.11030-2-andr2000@gmail.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/gntdev-dmabuf.c