RDMA/mlx5: Do not allow the user to write to the clock page
authorJason Gunthorpe <jgg@mellanox.com>
Tue, 16 Apr 2019 11:07:25 +0000 (14:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 May 2019 07:58:54 +0000 (09:58 +0200)
commit1af34bf97eca3624b5f2ec786527c8609e1a68b8
treea09aae519f59d8f4b3f4b22d3f89d5309ec7d7a1
parent8ac57d1bdc255f07c1cec130e8a860457e6bb7d3
RDMA/mlx5: Do not allow the user to write to the clock page

commit c660133c339f9ab684fdf568c0d51b9ae5e86002 upstream.

The intent of this VMA was to be read-only from user space, but the
VM_MAYWRITE masking was missed, so mprotect could make it writable.

Cc: stable@vger.kernel.org
Fixes: 5c99eaecb1fc ("IB/mlx5: Mmap the HCA's clock info to user-space")
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Haggai Eran <haggaie@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/infiniband/hw/mlx5/main.c