From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 68F54A00C5; Wed, 20 Jul 2022 15:43:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0546B40042; Wed, 20 Jul 2022 15:43:52 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 6CF3B4003C for ; Wed, 20 Jul 2022 15:43:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658324629; 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: in-reply-to:in-reply-to:references:references; bh=TUUfEPh6BkC6vqehzNG+RaFyS9HVR9KPfD0vbKsShYs=; b=WDoM/yyZysYXhCpvCXyw9Ds5TQeqihcxIsY5ATiaJbZLZhoI4gKJLd+uoqFTp3NHD7oHOk cHGbRsFCmscm17k5iFWj7Xx096QSTQn61z68h85389k0TcxSUXlpDs233GsWJxX0qyGbPv T7l4RJ4YGDT3n1+Xzz9ExagsMpZxaMw= Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-581-x1NiDMK2O0GvnNCkDCzKUQ-1; Wed, 20 Jul 2022 09:43:48 -0400 X-MC-Unique: x1NiDMK2O0GvnNCkDCzKUQ-1 Received: by mail-lj1-f198.google.com with SMTP id v24-20020a2e9258000000b0025dd6cdd737so279368ljg.11 for ; Wed, 20 Jul 2022 06:43:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TUUfEPh6BkC6vqehzNG+RaFyS9HVR9KPfD0vbKsShYs=; b=bzJMllvvAOf0kaLA9Z2w4NKNUjgt98C/llWcPshcVGRo9R8MGZt2Yj/w95fUQXHHSu 5IT+zeG7j/HT7RMegqEjiUTpMBra/YpBS+vf0OWNzGVtBETHVuvQtONDopn2KvRIXfce TPM3A5YgTTkeJh1YvTru5Gq36E7ohyKLFWKqVsnPdSHL++nfzevML95RSixPJ8uSxEtM Ed4FK5BpSeFZRoVP7xNvupqDHQDKeIA9r1EflGXQFffRKk+lpXUvhpBpE6PAUBIBqDNQ i07atyocoaBU8efNRFZIjVNVm3P3e4U0nub8yy8alY8OqCGNW8teWnQ0r0ZcMzT/pVle vd0g== X-Gm-Message-State: AJIora8GS8exAVQ+xcqXzpR4LaYO1Z4LouGABMrF2ijhjqpTASZhMi66 cRZmSe0ZtLXLGlx9UBTingTJx2cEdRw/NwxL2Fgw4/jSb2GLPP9f7z/H/E1zCqdQMHYPfEu3CmN B4UozgrqCNJLqjeI/PKE= X-Received: by 2002:a05:6512:3d8a:b0:489:c93c:5970 with SMTP id k10-20020a0565123d8a00b00489c93c5970mr20336477lfv.575.1658324627157; Wed, 20 Jul 2022 06:43:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uoMLFcnwE+cRLBpYf+N1i3Sl6C8dQzf7BKzceaXeLExlqFt5Bf0+x4HHAFKvRGRCuG/UdT82DBys6O/6X7r3c= X-Received: by 2002:a05:6512:3d8a:b0:489:c93c:5970 with SMTP id k10-20020a0565123d8a00b00489c93c5970mr20336468lfv.575.1658324626908; Wed, 20 Jul 2022 06:43:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Marchand Date: Wed, 20 Jul 2022 15:43:35 +0200 Message-ID: Subject: Re: [PATCH] crypto/ccp: Check for the NULL pointer after calling rte_malloc To: "Namburu, Chandu-babu" Cc: "dev@dpdk.org" , "835703180@qq.com" <835703180@qq.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Jul 20, 2022 at 8:29 AM Namburu, Chandu-babu wrote: > From: Shiqi Liu <835703180@qq.com> > > As the possible failure of the rte_malloc(), the not_checked and checked could be NULL pointer. > Therefore, it should be better to check it in order to avoid the dereference of the NULL pointer. > > Fixes: 09a0fd736a0 ("crypto/ccp: enable IOMMU") > Signed-off-by: Shiqi Liu <835703180@qq.com> This sha_ctx variable and its accesses are suspicious. It seems to be used as some kind of intermediate buffer, but I fail to see the need. Can't the existing code rely on sess->auth.ctx ? There is also a suspicious mention (in ccp_perform_sha) of sha_ctx but with no calling rte_mem_virt2iova(). -- David Marchand