]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
mlx4: Map core_clock page to user space only when allowed
authorHans Petter Selasky <hselasky@FreeBSD.org>
Wed, 16 Jun 2021 13:02:02 +0000 (15:02 +0200)
committerHans Petter Selasky <hselasky@FreeBSD.org>
Mon, 12 Jul 2021 12:22:35 +0000 (14:22 +0200)
commitc8301cbb0fa25d03c1b6b2d056497d5a1580a8b4
treeb79edf57dbfb34b2fabea8c9c18733bc226cf9ed
parentc8d16d1e084dc14191491e95ce226d3ce8b39275
mlx4: Map core_clock page to user space only when allowed

Currently when we map the hca_core_clock page to the user space,
there are vulnerable registers, one of which is semaphore, on
this page as well. If user read the wrong offset, it can modify the
above semaphore and hang the device.

Hence, mapping the hca_core_clock page to the user space only when
user required it specifically.

After this patch, mlx4 core_clock won't be mapped to user space by
default. Oppose to current state, where mlx4 core_clock is always mapped
to user space.

MFC after: 1 week
Reviewed by: kib
Sponsored by: Mellanox Technologies // NVIDIA Networking
sys/dev/mlx4/device.h
sys/dev/mlx4/mlx4_core/fw.h
sys/dev/mlx4/mlx4_core/mlx4_fw.c
sys/dev/mlx4/mlx4_core/mlx4_main.c
sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c