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 82CE0A00BE for ; Wed, 30 Oct 2019 08:56:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 33E1B1BED5; Wed, 30 Oct 2019 08:56:33 +0100 (CET) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 960DA1BED5 for ; Wed, 30 Oct 2019 08:56:31 +0100 (CET) Received: from mail-vk1-f199.google.com (mail-vk1-f199.google.com [209.85.221.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7D578535D for ; Wed, 30 Oct 2019 07:56:30 +0000 (UTC) Received: by mail-vk1-f199.google.com with SMTP id z23so631152vkb.3 for ; Wed, 30 Oct 2019 00:56:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zRNrktRCvaO2uWIQ0JJnt2xGnJkVlL6uekvu52Ep194=; b=jRWKNsPFfMcdz3BzutLlOxkKD3MnV794jzHdpiWpIjRy0moIp5If4NoZllZk/dVixx hAZ1J3UTFufvQgrGEA+8rNp8q67zYyfcP6b8c4lUHRDyWGiLQHneB0xGutCRCcrbq16/ PR1RQy5w4p3vosfUcRxQiUFi/RbLQbKtmq2DpUCS1CDu7PnUYEvFCk/Wx3EUTKYft+4Y INxCtohZXnomlRZ6c2e6wTOEG7xd1BJAlBZ7WXiU1i+cgyrwhoGafLJyhWjJbpQPgjyi LHYIT4rPfqUFs221P36na+g6+SAC7zxEzAYEKoNxxv5o+mVsrGiKR0iD96kS8I5C+xHv /g/Q== X-Gm-Message-State: APjAAAXzLmys8E8CvgcwGNFXoG+FS1GIKwzeZ9BC4w4PQusin+Uny83H RWr2psGXADvJAY+D2qt+8ISAjcN77aq7RRWYBBrUSnXj8WEXXFMWHxY71G8WabUTvV2M8tdiL3G rBrgkH7BOaoOtqhyKLtpQxt4= X-Received: by 2002:a05:6102:531:: with SMTP id m17mr4252522vsa.105.1572422190038; Wed, 30 Oct 2019 00:56:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoIqGLWpI1wOydpKp2utCnPo87MPBtSBwrazGXGVxgcO988DJ0XnsclSAqc7We0B4INTolZ8EMGirMKMBJEfU= X-Received: by 2002:a05:6102:531:: with SMTP id m17mr4252518vsa.105.1572422189818; Wed, 30 Oct 2019 00:56:29 -0700 (PDT) MIME-Version: 1.0 References: <20191001125315.6191-1-ktraynor@redhat.com> <20191001130405.7076-1-ktraynor@redhat.com> In-Reply-To: <20191001130405.7076-1-ktraynor@redhat.com> From: David Marchand Date: Wed, 30 Oct 2019 08:56:18 +0100 Message-ID: To: Kevin Traynor Cc: dev , Nithin Dabilpuram , dpdk stable , anoobj@marvell.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [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" On Tue, Oct 1, 2019 at 3:04 PM Kevin Traynor wrote: > > 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 Cc: maintainer > > 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 > Reviewed-by: David Marchand -- David Marchand