]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: qat - fix potential spectre issue
authorAdam Guerin <adam.guerin@intel.com>
Mon, 4 Jan 2021 17:21:57 +0000 (17:21 +0000)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 14 Jan 2021 06:10:26 +0000 (17:10 +1100)
commit63014d4095375494172a568766a5f03a8c83524f
tree673aa5e717ccd4d44e517e8f06e25c49f0534136
parent8b58eaa3a641ed74b63203d786ff1e0ba0e22736
crypto: qat - fix potential spectre issue

Sanitize ring_num value coming from configuration (and potentially
from user space) before it is used as index in the banks array.

This issue was detected by smatch:

    drivers/crypto/qat/qat_common/adf_transport.c:233 adf_create_ring() warn: potential spectre issue 'bank->rings' [r] (local cap)

Signed-off-by: Adam Guerin <adam.guerin@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/qat/qat_common/adf_transport.c