diff options
author | Jack Xu <jack.xu@intel.com> | 2021-05-17 12:13:13 +0300 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2021-05-28 09:20:40 +0300 |
commit | b9f7c36de97814d13c31aba560d520d61b86be0e (patch) | |
tree | 5305c4dde425cc5f3262a32f04b0a2ab013803b3 /drivers/crypto/qat/qat_common/qat_uclo.c | |
parent | fc9818e6c54d19f1189bbda906042af3aaf93d80 (diff) | |
download | linux-b9f7c36de97814d13c31aba560d520d61b86be0e.tar.xz |
crypto: qat - check MMP size before writing to the SRAM
Change "sram_visible" to "mmp_sram_size" and compare it with the MMP
size to prevent an overly large MMP file being written to SRAM.
Signed-off-by: Jack Xu <jack.xu@intel.com>
Co-developed-by: Zhehui Xiang <zhehui.xiang@intel.com>
Signed-off-by: Zhehui Xiang <zhehui.xiang@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/qat/qat_common/qat_uclo.c')
-rw-r--r-- | drivers/crypto/qat/qat_common/qat_uclo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/crypto/qat/qat_common/qat_uclo.c b/drivers/crypto/qat/qat_common/qat_uclo.c index d2c2db58c93f..8adf25769128 100644 --- a/drivers/crypto/qat/qat_common/qat_uclo.c +++ b/drivers/crypto/qat/qat_common/qat_uclo.c @@ -1551,7 +1551,7 @@ int qat_uclo_wr_mimage(struct icp_qat_fw_loader_handle *handle, status = qat_uclo_auth_fw(handle, desc); qat_uclo_ummap_auth_fw(handle, &desc); } else { - if (!handle->chip_info->sram_visible) { + if (handle->chip_info->mmp_sram_size < mem_size) { dev_dbg(&handle->pci_dev->dev, "QAT MMP fw not loaded for device 0x%x", handle->pci_dev->device); |