habanalabs: add validity check for event ID received from F/W
authorOfir Bitton <obitton@habana.ai>
Tue, 20 Jul 2021 06:16:05 +0000 (09:16 +0300)
committerDom Cobley <popcornmix@gmail.com>
Thu, 14 Oct 2021 11:33:04 +0000 (12:33 +0100)
commitf166de5dba1dd5a500c96d973e851d3bce6495a6
tree5ed8fed89a63c2826e01365ef71ab7a6db5675da
parentf249e66948f5c3e93012032f125ba4f7b66dfe55
habanalabs: add validity check for event ID received from F/W

[ Upstream commit a6c849012b0f51c674f52384bd9a4f3dc0a33c31 ]

Currently there is no validity check for event ID received from F/W,
Thus exposing driver to memory overrun.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi.c
drivers/misc/habanalabs/goya/goya.c