Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1057949pxb; Wed, 27 Oct 2021 18:26:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweJ8hM/zRczzXqa09t+mMeV38Z1oTidnPnN5UdSuVMaqS2AIdH5gNVVNpXOOchOOFqgV6g X-Received: by 2002:aa7:c846:: with SMTP id g6mr1883692edt.51.1635384384482; Wed, 27 Oct 2021 18:26:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635384384; cv=none; d=google.com; s=arc-20160816; b=PFLjk36Ry3uen2e8gupcYjFrBXsr9zb3A3C1A5cmm1k2foRjdfKcRdTHc+b+KULLgg R1XrE56Q9h8ai0rtOhjJ0QkLxv7bJjCP6ZCuMJTB3vjHHdIKLZf9oo9TRaMmR69z+iu0 xAe4B4/PRcuf86H14VzcS/aEe8v+RlJD41A3NPySMuK/vfyhZVdxzZKvOPqLsYw/eh6/ mkxLwGWeM2uH40jkdQFENOYh969AGBcWHeJ8IceXhbbh0RvQudRiGTCji9ik/etr9/Mb EJ06L1VKyC5xEc//zUsgMuSzYCbwRqdwuPCDI69Fu3kkm5dDlGgY5+x6nZi6DHWrlS+3 7Wgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=cQaLDylSFjNVWbnWpkRxcULmoY1vv78fc6GwwP0k1y8=; b=j6cusUGYTMRKpg2D35zUnU5nTlOhV3poS3R0SVvlQuZjsrlL6PB18x7tswuU0PuF4A 1xOjurfnSM2mpA2LjzvbWqH9NeVo9yqVvM/lpLM9ahE0xxfs8bBrGi818d5q9/DtETNj Xe++j97aAoIswVY35MJJLZ4U8DfteUzXz2OT7YfZLinOIe+HQSEe6nxndbvywBpu71Mw cqKZsZe0Y/lNckyLR1l1JjW3xpt6D2HzhxaIQOnworZmT8WKOthqbIzpSEukInXnFn/Y /HIrs9zPZNgGRax5yCCZACZB74EkSS6NbHR6XrNVq1OgKs0cd8MFYsHtwgNb/ti/YLYU W1YQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a1si1828801eds.292.2021.10.27.18.26.00; Wed, 27 Oct 2021 18:26:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hisilicon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229537AbhJ1B0q (ORCPT + 99 others); Wed, 27 Oct 2021 21:26:46 -0400 Received: from szxga01-in.huawei.com ([45.249.212.187]:29944 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbhJ1B0q (ORCPT ); Wed, 27 Oct 2021 21:26:46 -0400 Received: from dggeml757-chm.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Hfnls5mNrzbnK9; Thu, 28 Oct 2021 09:19:37 +0800 (CST) Received: from [10.67.103.22] (10.67.103.22) by dggeml757-chm.china.huawei.com (10.1.199.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.15; Thu, 28 Oct 2021 09:24:17 +0800 Message-ID: Date: Thu, 28 Oct 2021 09:24:12 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: drivers/crypto: suspected missing null check in hisi_qm_pre_init To: YE Chengfeng , "herbert@gondor.apana.org.au" , "davem@davemloft.net" CC: "linux-kernel@vger.kernel.org" References: From: Zhou Wang In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggeml757-chm.china.huawei.com (10.1.199.137) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi, > > https://github.com/torvalds/linux/blob/master/drivers/crypto/hisilicon/qm.c#L3286 > > We notice that at #line 3286, the return pointer of ACPI_COMPANION is not null-checked, and then it's dereferenced in acpi_device_power_manageable. Seems that it could be a potential null-pointer-dereference issue. > > This is detected by our experimental static analysis tool, it could be false positive, so we manually check and report those we think may be true bugs. Would you like to have a look at them? If it's real bug, we could like to provide patch to ease your workflow. Hi Chengfeng, It will reture NULL when ACPI is disabled, however this driver deponds on ACPI, which is already set in Kconfig. So no need do null-checked here. Thanks, Zhou > > Thanks so much, > Chengfeng > . >