summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/uverbs.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-04-16 14:07:28 +0300
committerJason Gunthorpe <jgg@mellanox.com>2019-04-24 13:32:25 -0300
commit67f269b37f9b4d52c5e7f97acea26c0852e9b8a1 (patch)
tree58f359e2dca30490e6962ae1c1933f05dab97a97 /drivers/infiniband/core/uverbs.h
parentd5e560d3f72382ac4e3bfe4e0f0420e6a220b039 (diff)
RDMA/ucontext: Fix regression with disassociate
When this code was consolidated the intention was that the VMA would become backed by anonymous zero pages after the zap_vma_pte - however this very subtly relied on setting the vm_ops = NULL and clearing the VM_SHARED bits to transform the VMA into an anonymous VMA. Since the vm_ops was removed this broke. Now userspace gets a SIGBUS if it touches the vma after disassociation. Instead of converting the VMA to anonymous provide a fault handler that puts a zero'd page into the VMA when user-space touches it after disassociation. Cc: stable@vger.kernel.org Suggested-by: Andrea Arcangeli <aarcange@redhat.com> Fixes: 5f9794dc94f5 ("RDMA/ucontext: Add a core API for mmaping driver IO memory") Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/core/uverbs.h')
-rw-r--r--drivers/infiniband/core/uverbs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h
index ea0bc6885517..32cc8fe7902f 100644
--- a/drivers/infiniband/core/uverbs.h
+++ b/drivers/infiniband/core/uverbs.h
@@ -160,6 +160,7 @@ struct ib_uverbs_file {
struct mutex umap_lock;
struct list_head umaps;
+ struct page *disassociate_page;
struct idr idr;
/* spinlock protects write access to idr */