habanalabs: prevent possible out-of-bounds array access
authorOded Gabbay <oded.gabbay@gmail.com>
Sun, 12 Jul 2020 20:34:57 +0000 (23:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:48 +0000 (09:58 +0200)
commitf4ad9dbc0224db919f5387fa146e07f2006f50f2
treecf06589d0f47f208f97a57a4d7cbbe813cf42177
parent15692a520ee4d3d21d78b5e63cf7467d691cf1db
habanalabs: prevent possible out-of-bounds array access

[ Upstream commit cea7a0449ea3fa4883bf5dc8397f000d6b67d6cd ]

Queue index is received from the user. Therefore, we must validate it
before using it to access the queue props array.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Tomer Tayar <ttayar@habana.ai>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/command_submission.c