Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7fc8ff26 authored by Leon Romanovsky's avatar Leon Romanovsky Committed by Doug Ledford
Browse files

RDMA/mlx4: Don't crash machine if zap_vma_ptes() fails



The failure reported by zap_vma_ptes() means that wrong VMA pages
were supplied, however it is impossible for this type of address.

Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 2cb40791
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -1186,7 +1186,6 @@ static const struct vm_operations_struct mlx4_ib_vm_ops = {
static void mlx4_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
{
	int i;
	int ret = 0;
	struct vm_area_struct *vma;
	struct mlx4_ib_ucontext *context = to_mucontext(ibcontext);

@@ -1198,13 +1197,8 @@ static void mlx4_ib_disassociate_ucontext(struct ib_ucontext *ibcontext)
		if (!vma)
			continue;

		ret = zap_vma_ptes(context->hw_bar_info[i].vma,
				   context->hw_bar_info[i].vma->vm_start,
				   PAGE_SIZE);
		if (ret) {
			pr_err("Error: zap_vma_ptes failed for index=%d, ret=%d\n", i, ret);
			BUG_ON(1);
		}
		zap_vma_ptes(context->hw_bar_info[i].vma,
			     context->hw_bar_info[i].vma->vm_start, PAGE_SIZE);

		context->hw_bar_info[i].vma->vm_flags &=
			~(VM_SHARED | VM_MAYSHARE);