linux/drivers/accel
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
..
habanalabs habanalabs: protect access to dynamic mem 'user_mappings' 2023-01-26 11:52:11 +02:00
ivpu accel/ivpu: Add PM support 2023-01-19 11:12:08 +01:00
drm_accel.c Fix mismerge due to devnode now taking a 'const *' device 2022-12-16 13:04:15 -06:00
Kconfig habanalabs: move driver to accel subsystem 2023-01-26 11:52:10 +02:00
Makefile habanalabs: move driver to accel subsystem 2023-01-26 11:52:10 +02:00