Skip to content
Commit 2d2db7d4 authored by Oleksandr Tyshchenko's avatar Oleksandr Tyshchenko Committed by Juergen Gross
Browse files

xen/gntdev: Fix the abuse of underlying struct page in DMA-buf import



DO NOT access the underlying struct page of an sg table exported
by DMA-buf in dmabuf_imp_to_refs(), this is not allowed.
Please see drivers/dma-buf/dma-buf.c:mangle_sg_table() for details.

Fortunately, here (for special Xen device) we can avoid using
pages and calculate gfns directly from dma addresses provided by
the sg table.

Suggested-by: default avatarDaniel Vetter <daniel@ffwll.ch>
Signed-off-by: default avatarOleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarStefano Stabellini <sstabellini@kernel.org>
Acked-by: default avatarDaniel Vetter <daniel@ffwll.ch>
Link: https://lore.kernel.org/r/20240107103426.2038075-1-olekstysh@gmail.com
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
parent f1479f0a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment