habanalabs: proper handling of alloc size in coresight
authorOfir Bitton <obitton@habana.ai>
Thu, 6 Aug 2020 08:33:27 +0000 (11:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Sep 2020 17:14:09 +0000 (19:14 +0200)
commit3a24b9420ee0a0f146840c29883d671327e00f4c
treeaed426350fff9d30d77a01cab8e8d98d09dc50c8
parenta8d7e55996142aea8747d701d17d32560d86496a
habanalabs: proper handling of alloc size in coresight

[ Upstream commit 36545279f076afeb77104f5ffeab850da3b6d107 ]

Allocation size can go up to 64bit but truncated to 32bit,
we should make sure it is not truncated and validate no address
overflow.

Signed-off-by: Ofir Bitton <obitton@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi_coresight.c
drivers/misc/habanalabs/goya/goya_coresight.c
drivers/misc/habanalabs/habanalabs.h