From: Greg Kroah-Hartman Date: Fri, 25 Mar 2022 13:23:52 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.9.309~30 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=489926e7f5ea6dbf70bb57773f31a99d74d2aab4;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: crypto-qat-disable-registration-of-algorithms.patch --- diff --git a/queue-4.14/crypto-qat-disable-registration-of-algorithms.patch b/queue-4.14/crypto-qat-disable-registration-of-algorithms.patch new file mode 100644 index 00000000000..cd0ca168752 --- /dev/null +++ b/queue-4.14/crypto-qat-disable-registration-of-algorithms.patch @@ -0,0 +1,45 @@ +From 8893d27ffcaf6ec6267038a177cb87bcde4dd3de Mon Sep 17 00:00:00 2001 +From: Giovanni Cabiddu +Date: Fri, 4 Mar 2022 17:54:47 +0000 +Subject: crypto: qat - disable registration of algorithms + +From: Giovanni Cabiddu + +commit 8893d27ffcaf6ec6267038a177cb87bcde4dd3de 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 +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/qat/qat_common/qat_crypto.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/crypto/qat/qat_common/qat_crypto.c ++++ b/drivers/crypto/qat/qat_common/qat_crypto.c +@@ -170,6 +170,14 @@ int qat_crypto_dev_config(struct adf_acc + goto err; + if (adf_cfg_section_add(accel_dev, "Accelerator0")) + goto err; ++ ++ /* Temporarily set the number of crypto instances to zero to avoid ++ * registering the crypto algorithms. ++ * This will be removed when the algorithms will support the ++ * CRYPTO_TFM_REQ_MAY_BACKLOG flag ++ */ ++ instances = 0; ++ + for (i = 0; i < instances; i++) { + val = i; + snprintf(key, sizeof(key), ADF_CY "%d" ADF_RING_BANK_NUM, i); diff --git a/queue-4.14/series b/queue-4.14/series index 08b03361631..88d569d44b4 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -13,3 +13,4 @@ netfilter-nf_tables-initialize-registers-in-nft_do_chain.patch acpi-x86-work-around-broken-xsdt-on-advantech-dac-bj01-board.patch acpi-battery-add-device-hid-and-quirk-for-microsoft-surface-go-3.patch acpi-video-force-backlight-native-for-clevo-nl5xru-and-nl5xnu.patch +crypto-qat-disable-registration-of-algorithms.patch