summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorShay Drory <shayd@nvidia.com>2021-06-03 16:19:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-16 11:55:01 +0200
commit6fe8d68e4ce966995c56e9d8b887dea43c92acbf (patch)
tree667fa9c874d2ef984c910d9b953f70b5303db5d2 /include/linux
parent0856f2301d3be6bd828e8091716944b66304f812 (diff)
downloadlinux-stable-6fe8d68e4ce966995c56e9d8b887dea43c92acbf.tar.gz
linux-stable-6fe8d68e4ce966995c56e9d8b887dea43c92acbf.tar.bz2
linux-stable-6fe8d68e4ce966995c56e9d8b887dea43c92acbf.zip
RDMA/mlx4: Do not map the core_clock page to user space unless enabled
commit 404e5a12691fe797486475fe28cc0b80cb8bef2c upstream. Currently when mlx4 maps the hca_core_clock page to the user space there are read-modifiable registers, one of which is semaphore, on this page as well as the clock counter. If user reads the wrong offset, it can modify the semaphore and hang the device. Do not map the hca_core_clock page to the user space unless the device has been put in a backwards compatibility mode to support this feature. After this patch, mlx4 core_clock won't be mapped to user space on the majority of existing devices and the uverbs device time feature in ibv_query_rt_values_ex() will be disabled. Fixes: 52033cfb5aab ("IB/mlx4: Add mmap call to map the hardware clock") Link: https://lore.kernel.org/r/9632304e0d6790af84b3b706d8c18732bc0d5e27.1622726305.git.leonro@nvidia.com Signed-off-by: Shay Drory <shayd@nvidia.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mlx4/device.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index dca6ab4eaa99..3ebdd384ae33 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -631,6 +631,7 @@ struct mlx4_caps {
bool wol_port[MLX4_MAX_PORTS + 1];
struct mlx4_rate_limit_caps rl_caps;
u32 health_buffer_addrs;
+ bool map_clock_to_user;
};
struct mlx4_buf_list {