Jason Gunthorpe 67f269b37f 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>
2019-04-24 13:32:25 -03:00
..
2019-01-07 11:43:03 -07:00
2019-02-19 10:13:39 -07:00
2019-03-11 20:06:18 -07:00
2018-12-12 07:40:16 -07:00
2019-02-19 20:52:19 -07:00
2019-02-19 10:13:39 -07:00
2016-05-13 13:37:18 -04:00
2019-02-22 11:53:37 -07:00
2018-12-12 07:40:16 -07:00
2016-03-03 10:20:25 -05:00
2019-03-11 20:06:18 -07:00
2018-12-12 07:40:16 -07:00
2019-02-19 10:13:39 -07:00
2018-12-12 07:40:16 -07:00
2016-03-03 10:20:25 -05:00