Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp92369lqa; Fri, 26 Apr 2024 15:47:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUH4lFcVsbuS6BephGJ02y+/NWwKz1rYCDuywuV6AgjFmdXhR2lgkKtR81NqrUuV11OYRx6Q52A4Epl5j8yYVIX+9oIFUXFpLy4Btz7vw== X-Google-Smtp-Source: AGHT+IGwyt2DEFY9vLMNwlPprPMIrgUe/Grya28cEXGjt353ROxB4Z2pYYnHaFUOzl8q5PKRkvTM X-Received: by 2002:a05:620a:4acb:b0:790:8915:7402 with SMTP id sq11-20020a05620a4acb00b0079089157402mr4325597qkn.53.1714171677565; Fri, 26 Apr 2024 15:47:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714171677; cv=pass; d=google.com; s=arc-20160816; b=gNbXlgwQr6wDr42uWpGdToRnFd5IQ/Qgv05sWVwzM82VK2YNX6mX7ZnlQLxKMFS21q p3vtHP2RWpVWCXnhn4uTiOSvQedwfCQfIzDZVffZOgGgkYiWTErRWlJYpxmyB2r/wZFH N0aFzT9znIJ2+pM7t0dio8yYnRhT83jhpUPsDSLYIWTBwE9McrxbM5q90YEFytoW5aNZ 6F2o6gsLBqDKC7a8kkrT4BQqM++MtHOqKlgk0tNJU3qDgEcq7aTcLdfjOxGqjbX8juk/ FdgO6w73C4xr1EP84LjQg3U62djCIKH1D+Nh63kFc8qE335LoTrqDurqw+bJWS2qBKk/ JYnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date:dkim-signature; bh=XHggFEigq9n45+2kHw8Vn+8EWY7O/itt6deLI8zmi/E=; fh=gSD7svL6ffCqBxItCrA9ZDrAE79vCUS5/bKEtY9WJXU=; b=ms5kV4bVzsTKcHZiVtAkEPaglxKCUpGWyZuRftrpoL5BlMCnJ1WTP8i41HCymrcCj9 HYOZ2aWDqJy4Pd7VgH7V+49RymWb647dfaEbuevfaglXwkMYXtKKQSfUkuySHt3mAMKh jgKcQKiq8bFIBoxFL3UZL73pkHAdvoEC7hpp6kCaGDwvHKa3hCuVO44yJ7hY4m/62UZX sQZSIHL+JA6ODagVlW5YTZCHCYJPCW616ar3BlufkgxvKeGjEDvjjrVD8BkeVXfArL5/ IS4vITIHtwJvXiitqbO/YaI7WxZvNymNvpoNjLNDo7FZlcGmP19rEH57rQm0KTT7RV/X 0AiA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ifll98HQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160752-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l8-20020a37f508000000b0078d63795738si20732089qkk.277.2024.04.26.15.47.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 15:47:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-160752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ifll98HQ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-160752-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-160752-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4A47A1C21FCB for ; Fri, 26 Apr 2024 22:47:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1BD0339FF2; Fri, 26 Apr 2024 22:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ifll98HQ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 42C073987B; Fri, 26 Apr 2024 22:47:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714171668; cv=none; b=ChnUGvBYDptmesORhvfgr09ii7U5ypJeeaI+xMD/voO7oNAyjY4g9gJI9qDHmWmYktct4l7gUjAnnn59cfe00pl0oU8nQi8yfaWwIxUxPa5Kfd+UFT19+fPIv9NP6b3MqVobwdqR9DZisd7lzuXzXgNv6Xo4CfBEzk/7TQGGte4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714171668; c=relaxed/simple; bh=yQE9PcLddlqN+PjCL2wReDNOleVRYw7TxRmvpGTP2kQ=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; b=X30lyTFI5CvuVREGFAweZv4qcZdiWJ9XiEWWTugx3HdejCmtlTAN+nhIn9rAJ5giYI21+txk35KYklBsixPoLiD2ld8oQDB3y6zzURbrsoPeDInXEQd8hPCqEdKxLm4OlReRBahPiaUZSJZU8+WtYGih8QvMRBRofzlZqneaoXQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ifll98HQ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C906C113CD; Fri, 26 Apr 2024 22:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714171667; bh=yQE9PcLddlqN+PjCL2wReDNOleVRYw7TxRmvpGTP2kQ=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ifll98HQNoPtaFrvJKYgNdp1fbYND85HXjZGlEB8//OewHQRBhyw8SH2woc5dB4OH Lnu90GwsjucyG5unuHJrLCu5J9OhMWCT2fehQGrdgcyaGLrwR58+3FYQs5e/uc6+3m QY4n2PBYcTe3Cw0/38IQsAJhUn7qenmF95d/BsUvsZ20XxjGafYloHeUvyW+hf8KJK 28s7ZXajI9iuEMxLXcwLXnEkUxV9bP132JTnKg7vM6P+a9qrQCnt03hJEMqZdfbw79 Vxy2iQBLE1AQIn3RxSjRKji3vZUS+dS6h15y696/ulumtlRnFdMVW6AJKRhdLQOVK6 ZjYBOFOIUT4jA== Date: Fri, 26 Apr 2024 17:47:46 -0500 From: Bjorn Helgaas To: Alexander Lobakin Cc: Aleksandr Mishin , Rob Herring , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Bjorn Helgaas , Manivannan Sadhasivam , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Serge Semin , Niklas Cassel , Yoshihiro Shimoda , Damien Le Moal , Siddharth Vadapalli , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, lvc-project@linuxtesting.org Subject: Re: [PATCH v2] PCI: dwc: keystone: Fix potential NULL dereference Message-ID: <20240426224746.GA611050@bhelgaas> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63b89455-3e30-421a-a082-00d39e836e20@intel.com> On Thu, Apr 25, 2024 at 03:00:14PM +0200, Alexander Lobakin wrote: > From: Aleksandr Mishin > Date: Thu, 25 Apr 2024 12:21:35 +0300 > > > In ks_pcie_setup_rc_app_regs() resource_list_first_type() may return > > NULL which is later dereferenced. Fix this bug by adding NULL check. > > > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Please stop spamming with "potential fixes" made mechanically from > static analyzer reports without looking into the code flow. These > patches are mostly incorrect and may hurt. > Either have a stable repro and then fix the real bug or don't touch > anything at all. Did you look at the actual patch? I'm not a keystone expert, but this patch looks reasonable to me. It might still be the case that we're guaranteed to have an IORESOURCE_MEM window by other code, but it looks like a real hassle to prove that. > > Fixes: 0f71c60ffd26 ("PCI: dwc: Remove storing of PCI resources") > > Signed-off-by: Aleksandr Mishin > > Thanks, > Olek