From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 175C9A2EDB for ; Tue, 1 Oct 2019 15:04:15 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CB58937B4; Tue, 1 Oct 2019 15:04:14 +0200 (CEST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 5DD6137B4; Tue, 1 Oct 2019 15:04:13 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A6166BCFE2; Tue, 1 Oct 2019 13:04:12 +0000 (UTC) Received: from rh.redhat.com (unknown [10.36.118.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6D0A15C223; Tue, 1 Oct 2019 13:04:11 +0000 (UTC) From: Kevin Traynor To: dev@dpdk.org Cc: Kevin Traynor , ndabilpuram@marvell.com, stable@dpdk.org Date: Tue, 1 Oct 2019 14:03:58 +0100 Message-Id: <20191001130405.7076-1-ktraynor@redhat.com> In-Reply-To: <20191001125315.6191-1-ktraynor@redhat.com> References: <20191001125315.6191-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 01 Oct 2019 13:04:12 +0000 (UTC) Subject: [dpdk-stable] [PATCH 2/9] crypto/octeontx: fix possible NULL deference 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: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Coverity complains that ctrl_flags is set to NULL at the start of the function and it may not have been set before there is a jump to fc_success and it is dereferenced. Check for NULL before dereference. 312fc_success: CID 344983 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)7. var_deref_op: Dereferencing null pointer ctrl_flags. 313 *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags); Coverity issue: 344983 Fixes: 6cc54096520d ("crypto/octeontx: add supported sessions") Cc: ndabilpuram@marvell.com Cc: stable@dpdk.org Signed-off-by: Kevin Traynor --- There may be further rework needed to set it to the correct value, but for now at least prevent the NULL dereference. --- drivers/common/cpt/cpt_ucode.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h index 7d9c31e17..fad978c6e 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h @@ -311,5 +311,6 @@ cpt_fc_ciph_set_key(void *ctx, cipher_type_t type, const uint8_t *key, fc_success: - *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags); + if (ctrl_flags != NULL) + *ctrl_flags = rte_cpu_to_be_64(*ctrl_flags); success: -- 2.21.0