patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 16.11] crypto/qat: fix checks for 3GPP algo bit params
@ 2018-08-02  8:42 Fiona Trahe
  2018-08-02 10:07 ` Luca Boccassi
  0 siblings, 1 reply; 2+ messages in thread
From: Fiona Trahe @ 2018-08-02  8:42 UTC (permalink / raw)
  To: stable; +Cc: fiona.trahe

[ backported from upstream commit 64cb90f882704df2cc18e49437ddfdba088dd898 ]

QAT driver checks byte alignment for KASUMI/SNOW_3G algorithms using
cipher/auth_param, which are not initialized at this moment yet. Use
operation params instead.

Fixes: a59ffe7eb952 ("cryptodev: add bit-wise handling for SNOW 3G")

Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
 drivers/crypto/qat/qat_crypto.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/qat/qat_crypto.c b/drivers/crypto/qat/qat_crypto.c
index a941679..65e11fd 100644
--- a/drivers/crypto/qat/qat_crypto.c
+++ b/drivers/crypto/qat/qat_crypto.c
@@ -1004,9 +1004,8 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg)
 			ctx->qat_cipher_alg == ICP_QAT_HW_CIPHER_ALGO_KASUMI) {
 
 			if (unlikely(
-				(cipher_param->cipher_length % BYTE_LENGTH != 0)
-				 || (cipher_param->cipher_offset
-							% BYTE_LENGTH != 0))) {
+			    (op->sym->cipher.data.length % BYTE_LENGTH != 0) ||
+			    (op->sym->cipher.data.offset % BYTE_LENGTH != 0))) {
 				PMD_DRV_LOG(ERR,
 		  "SNOW3G/KASUMI in QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
@@ -1047,8 +1046,9 @@ qat_write_hw_desc_entry(struct rte_crypto_op *op, uint8_t *out_msg)
 
 		if (ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_SNOW_3G_UIA2 ||
 			ctx->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9) {
-			if (unlikely((auth_param->auth_off % BYTE_LENGTH != 0)
-				|| (auth_param->auth_len % BYTE_LENGTH != 0))) {
+			if (unlikely(
+			    (op->sym->auth.data.offset % BYTE_LENGTH != 0) ||
+			    (op->sym->auth.data.length % BYTE_LENGTH != 0))) {
 				PMD_DRV_LOG(ERR,
 		"For SNOW3G/KASUMI, QAT PMD only supports byte aligned values");
 				op->status = RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH 16.11] crypto/qat: fix checks for 3GPP algo bit params
  2018-08-02  8:42 [dpdk-stable] [PATCH 16.11] crypto/qat: fix checks for 3GPP algo bit params Fiona Trahe
@ 2018-08-02 10:07 ` Luca Boccassi
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Boccassi @ 2018-08-02 10:07 UTC (permalink / raw)
  To: Fiona Trahe, stable

On Thu, 2018-08-02 at 09:42 +0100, Fiona Trahe wrote:
> [ backported from upstream commit
> 64cb90f882704df2cc18e49437ddfdba088dd898 ]
> 
> QAT driver checks byte alignment for KASUMI/SNOW_3G algorithms using
> cipher/auth_param, which are not initialized at this moment yet. Use
> operation params instead.
> 
> Fixes: a59ffe7eb952 ("cryptodev: add bit-wise handling for SNOW 3G")
> 
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
> ---
>  drivers/crypto/qat/qat_crypto.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)

Hi,

Thanks, applied and pushed to dpdk-stable/16.11.

-- 
Kind regards,
Luca Boccassi

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-02 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-02  8:42 [dpdk-stable] [PATCH 16.11] crypto/qat: fix checks for 3GPP algo bit params Fiona Trahe
2018-08-02 10:07 ` Luca Boccassi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).