Skip to content

Commit c971e6a

Browse files
gcabiddugregkh
authored andcommitted
crypto: qat - disable registration of algorithms
commit 8893d27 upstream. The implementations of aead and skcipher in the QAT driver do not support properly requests with the CRYPTO_TFM_REQ_MAY_BACKLOG flag set. If the HW queue is full, the driver returns -EBUSY but does not enqueue the request. This can result in applications like dm-crypt waiting indefinitely for a completion of a request that was never submitted to the hardware. To avoid this problem, disable the registration of all crypto algorithms in the QAT driver by setting the number of crypto instances to 0 at configuration time. Cc: stable@vger.kernel.org Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 9f4e646 commit c971e6a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/crypto/qat/qat_common/qat_crypto.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ int qat_crypto_dev_config(struct adf_accel_dev *accel_dev)
126126
goto err;
127127
if (adf_cfg_section_add(accel_dev, "Accelerator0"))
128128
goto err;
129+
130+
/* Temporarily set the number of crypto instances to zero to avoid
131+
* registering the crypto algorithms.
132+
* This will be removed when the algorithms will support the
133+
* CRYPTO_TFM_REQ_MAY_BACKLOG flag
134+
*/
135+
instances = 0;
136+
129137
for (i = 0; i < instances; i++) {
130138
val = i;
131139
snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_BANK_NUM, i);

0 commit comments

Comments
 (0)