diff options
author | Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com> | 2017-10-20 17:27:49 -0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-23 11:34:42 +0200 |
commit | de4ce2d1ad1bb3304d4107160c9551b7fd8d8ec5 (patch) | |
tree | 83bac440666d3ebb2f92c079d6310a265d3fa91e /drivers/hv/channel_mgmt.c | |
parent | 75f98b7ab748a6f604d667d84ec46acc452fdfc1 (diff) |
genwqe: Take R/W permissions into account when dealing with memory pages
Currently we assume userspace pages are always writable when doing
memory pinning. This is not true, specially since userspace applications
may allocate their memory the way they want, we have no control over it.
If a read-only page is set for pinning, currently the driver fails due
to get_user_pages_fast() refusing to map read-only pages as writable.
This patch changes this behavior, by taking the permission flags of the
pages into account in both pinning/unpinning process, as well as in the
DMA data copy-back to userpace (which we shouldn't try to do blindly,
since it will fail in case of read-only-pages).
Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Signed-off-by: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/channel_mgmt.c')
0 files changed, 0 insertions, 0 deletions