cryptodev: fix missing device id range checking
authorAdam Dybkowski <adamx.dybkowski@intel.com>
Thu, 20 Feb 2020 15:04:15 +0000 (16:04 +0100)
committerAkhil Goyal <akhil.goyal@oss.nxp.com>
Sun, 5 Apr 2020 16:26:04 +0000 (18:26 +0200)
commit285b5d1b1fd3c5240c691e3ba33eeb7c1e2c67c3
tree710bc65afed4592f7a7abd19f3c85b1ee15c7b9a
parent09e72e8499a91c67349fe3ebb2c4350339f95ec8
cryptodev: fix missing device id range checking

This patch adds range-checking of the device id passed from
the user app code. It prevents out-of-range array accesses
which in some situations resulted in an
application crash (segfault).

Fixes: 3dd4435cf473 ("cryptodev: fix checks related to device id")
Cc: stable@dpdk.org
Signed-off-by: Adam Dybkowski <adamx.dybkowski@intel.com>
Acked-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
lib/librte_cryptodev/rte_cryptodev.c