linux/drivers/accel/habanalabs
Koby Elbaz 571d1a7222 habanalabs: protect access to dynamic mem 'user_mappings'
When HL_INFO_USER_MAPPINGS IOCTL is called, we copy_to_user from
a dynamically allocated memory - 'user_mappings'.
Since freeing/allocating it happens in runtime (upon a page fault),
it not unlikely to access it even before being initially allocated
(i.e., accessing a NULL pointer).

The solution is to simply mark the spot when the err info has been
collected, and that way to know whether err info (either page fault
or RAZWI) is available to be read.

Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
2023-01-26 11:52:11 +02:00
..
common habanalabs: protect access to dynamic mem 'user_mappings' 2023-01-26 11:52:11 +02:00
gaudi habanalabs/gaudi: allow device acquire while in debug mode 2023-01-26 11:52:11 +02:00
gaudi2 habanalabs/gaudi2: avoid reconfiguring the same PB registers 2023-01-26 11:52:11 +02:00
goya
include habanalabs/gaudi2: avoid reconfiguring the same PB registers 2023-01-26 11:52:11 +02:00
Kconfig
Makefile