|
|
@@ -2014,6 +2014,7 @@ static int mlx5_ib_mmap_clock_info_page(struct mlx5_ib_dev *dev,
|
|
|
|
|
|
if (vma->vm_flags & VM_WRITE)
|
|
|
return -EPERM;
|
|
|
+ vma->vm_flags &= ~VM_MAYWRITE;
|
|
|
|
|
|
if (!dev->mdev->clock_info_page)
|
|
|
return -EOPNOTSUPP;
|
|
|
@@ -2197,6 +2198,7 @@ static int mlx5_ib_mmap(struct ib_ucontext *ibcontext, struct vm_area_struct *vm
|
|
|
|
|
|
if (vma->vm_flags & VM_WRITE)
|
|
|
return -EPERM;
|
|
|
+ vma->vm_flags &= ~VM_MAYWRITE;
|
|
|
|
|
|
/* Don't expose to user-space information it shouldn't have */
|
|
|
if (PAGE_SIZE > 4096)
|