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 0D47DA04AB for ; Wed, 6 Nov 2019 20:02:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 905591E87B; Wed, 6 Nov 2019 20:02:32 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 2A63F1E85D for ; Wed, 6 Nov 2019 20:02:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573066947; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bsrCM0ug/pCjMiM0vDZz75VjM1S3KqQaLQml0riDCh0=; b=GZ8+tWNyR8sIZS86X4A6fcWrs+oxDvMmD5gGGX67dkvkMb6hxtUi99oF685Jzmcs6Sh6Ad 0GI4zaIo8kBOElJYVTNwxWFx87HVyMQBLxl8i/HstrmkZ+7yJ/vU9JbfhcDEpI4ltx6H14 DLrsYQBowX3Fxzf9zusondNAWX/irUA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-214-s7PDk2WuNG2V6xLkxXtH0A-1; Wed, 06 Nov 2019 14:02:25 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ABB5E1005500; Wed, 6 Nov 2019 19:02:24 +0000 (UTC) Received: from rh.redhat.com (unknown [10.36.118.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A01B1001B35; Wed, 6 Nov 2019 19:02:23 +0000 (UTC) From: Kevin Traynor To: dev@dpdk.org Cc: david.marchand@redhat.com, Kevin Traynor , ndabilpuram@marvell.com, stable@dpdk.org Date: Wed, 6 Nov 2019 19:01:57 +0000 Message-Id: <20191106190203.10750-3-ktraynor@redhat.com> In-Reply-To: <20191106190203.10750-1-ktraynor@redhat.com> References: <20191001125315.6191-1-ktraynor@redhat.com> <20191106190203.10750-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: s7PDk2WuNG2V6xLkxXtH0A-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] [v2 PATCH 2/8] common/cpt: 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 =3D 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 Reviewed-by: David Marchand --- 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 0dac12ee3..d5a0135d7 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, cons= t uint8_t *key, =20 fc_success: -=09*ctrl_flags =3D rte_cpu_to_be_64(*ctrl_flags); +=09if (ctrl_flags !=3D NULL) +=09=09*ctrl_flags =3D rte_cpu_to_be_64(*ctrl_flags); =20 success: --=20 2.21.0