-
由 Shay Drory 提交于
stable inclusion from stable-v5.10.44 commit cb1aa1da04882d1860f733e24aeebdbbc85724d7 bugzilla: https://bugzilla.openeuler.org/show_bug.cgi?id=454 CVE: NA ------------------------------------------------- commit 404e5a12 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: 52033cfb ("IB/mlx4: Add mmap call to map the hardware clock") Link: https://lore.kernel.org/r/9632304e0d6790af84b3b706d8c18732bc0d5e27.1622726305.git.leonro@nvidia.comSigned-off-by: NShay Drory <shayd@nvidia.com> Signed-off-by: NLeon Romanovsky <leonro@nvidia.com> Signed-off-by: NJason Gunthorpe <jgg@nvidia.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Ngaodawei <810789471@qq.com> Reviewed-by: NJian Cheng <cj.chengjian@huawei.com> Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
8d43cdb3