From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id C57C2A3 for ; Fri, 8 Mar 2019 18:48:17 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 8 Mar 2019 19:48:13 +0200 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x28HloAT002625; Fri, 8 Mar 2019 19:48:11 +0200 From: Yongseok Koh To: Arek Kusztal Cc: Fiona Trahe , Marko Kovacevic , dpdk stable Date: Fri, 8 Mar 2019 09:46:51 -0800 Message-Id: <20190308174749.30771-13-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190308174749.30771-1-yskoh@mellanox.com> References: <20190308174749.30771-1-yskoh@mellanox.com> Subject: [dpdk-stable] patch 'crypto/qat: fix block size error handling' has been queued to LTS release 17.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2019 17:48:18 -0000 Hi, FYI, your patch has been queued to LTS release 17.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 03/13/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Yongseok --- >>From eee8f9986f01de6e517ea71d624dbc2de653e48b Mon Sep 17 00:00:00 2001 From: Arek Kusztal Date: Wed, 12 Dec 2018 20:59:02 +0100 Subject: [PATCH] crypto/qat: fix block size error handling [ upstream commit 93685b1fbf37d508032a4d640b67cd63075f93b9 ] Error code of qat_hash_get_block_size needs to be handle properly. Fixes: 10b49880e3c5 ("crypto/qat: make the session struct variable in size") Signed-off-by: Arek Kusztal Acked-by: Fiona Trahe Tested-by: Marko Kovacevic Acked-by: Marko Kovacevic --- drivers/crypto/qat/qat_adf/qat_algs_build_desc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c index 26f854c21..b9393810b 100644 --- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c +++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c @@ -413,8 +413,8 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg, } block_size = qat_hash_get_block_size(hash_alg); - if (block_size <= 0) - return -EFAULT; + if (block_size < 0) + return block_size; /* init ipad and opad from key and xor with fixed values */ memset(ipad, 0, block_size); memset(opad, 0, block_size); @@ -753,9 +753,13 @@ int qat_alg_aead_session_create_content_desc_auth(struct qat_session *cdesc, || cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9 || cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) hash->auth_counter.counter = 0; - else - hash->auth_counter.counter = rte_bswap32( - qat_hash_get_block_size(cdesc->qat_hash_alg)); + else { + int block_size = qat_hash_get_block_size(cdesc->qat_hash_alg); + + if (block_size < 0) + return block_size; + hash->auth_counter.counter = rte_bswap32(block_size); + } cdesc->cd_cur_ptr += sizeof(struct icp_qat_hw_auth_setup); -- 2.11.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-03-08 09:46:41.024514050 -0800 +++ 0013-crypto-qat-fix-block-size-error-handling.patch 2019-03-08 09:46:40.011398000 -0800 @@ -1,26 +1,27 @@ -From 93685b1fbf37d508032a4d640b67cd63075f93b9 Mon Sep 17 00:00:00 2001 +From eee8f9986f01de6e517ea71d624dbc2de653e48b Mon Sep 17 00:00:00 2001 From: Arek Kusztal Date: Wed, 12 Dec 2018 20:59:02 +0100 Subject: [PATCH] crypto/qat: fix block size error handling +[ upstream commit 93685b1fbf37d508032a4d640b67cd63075f93b9 ] + Error code of qat_hash_get_block_size needs to be handle properly. Fixes: 10b49880e3c5 ("crypto/qat: make the session struct variable in size") -Cc: stable@dpdk.org Signed-off-by: Arek Kusztal Acked-by: Fiona Trahe Tested-by: Marko Kovacevic Acked-by: Marko Kovacevic --- - drivers/crypto/qat/qat_sym_session.c | 14 +++++++++----- + drivers/crypto/qat/qat_adf/qat_algs_build_desc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c -index 8196e2333..272177f0a 100644 ---- a/drivers/crypto/qat/qat_sym_session.c -+++ b/drivers/crypto/qat/qat_sym_session.c -@@ -1143,8 +1143,8 @@ static int qat_sym_do_precomputes(enum icp_qat_hw_auth_algo hash_alg, +diff --git a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c +index 26f854c21..b9393810b 100644 +--- a/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c ++++ b/drivers/crypto/qat/qat_adf/qat_algs_build_desc.c +@@ -413,8 +413,8 @@ static int qat_alg_do_precomputes(enum icp_qat_hw_auth_algo hash_alg, } block_size = qat_hash_get_block_size(hash_alg); @@ -31,9 +32,9 @@ /* init ipad and opad from key and xor with fixed values */ memset(ipad, 0, block_size); memset(opad, 0, block_size); -@@ -1490,9 +1490,13 @@ int qat_sym_session_aead_create_cd_auth(struct qat_sym_session *cdesc, - || cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_AES_XCBC_MAC - ) +@@ -753,9 +753,13 @@ int qat_alg_aead_session_create_content_desc_auth(struct qat_session *cdesc, + || cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_KASUMI_F9 + || cdesc->qat_hash_alg == ICP_QAT_HW_AUTH_ALGO_ZUC_3G_128_EIA3) hash->auth_counter.counter = 0; - else - hash->auth_counter.counter = rte_bswap32(