Jonas Larsson fa575cdad7 staging: gasket: don't require all pages to be writable
Buffers to be mapped as DMA_TO_DEVICE must be writable due to the
'write' argument to get_user_pages_fast being hard coded to 1.
This prevents userspace from passing in pointers returned from
mmap(fd, PROT_READ), instead mmap(fd, PROT_READ | PROT_WRITE)
must be used even if the buffer is supposed to be read only.

Instead set writable to non zero iff direction != DMA_TO_DEVICE,
ie only buffers with DMA_FROM_DEVICE or DMA_BIDIRECTIONAL are
required to be writable.

Change-Id: I21c97b2bb855e11ecaa6ae9e81cf8b463b4aedaa
Signed-off-by: Jonas Larsson <ljonas@google.com>
2020-04-17 09:36:21 -07:00
Description
No description provided
356 KiB
Languages
C 99.8%
Makefile 0.2%