lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Apr 2022 16:28:53 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     bhelgaas@...gle.com, rafael@...nel.org
Cc:     linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Len Brown <lenb@...nel.org>, linux-pci@...r.kernel.org,
        linux-acpi@...r.kernel.org, whitehat002 <hackyzh002@...il.com>
Subject: [PATCH] PCI/ACPI: do not reference a pci device after it has been released

In acpi_get_pci_dev(), the debugging message for when a PCI bridge is
not found uses a pointer to a pci device whose reference has just been
dropped.  The chance that this really is a device that is now been
removed from the system is almost impossible to happen, but to be safe,
let's print out the debugging message based on the acpi root device
which we do have a valid reference to at the moment.

Cc: Bjorn Helgaas <bhelgaas@...gle.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: Len Brown <lenb@...nel.org>
Cc: linux-pci@...r.kernel.org
Cc: linux-acpi@...r.kernel.org
Reported-by: whitehat002 <hackyzh002@...il.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
 drivers/acpi/pci_root.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c
index 6f9e75d14808..ecda378dbc09 100644
--- a/drivers/acpi/pci_root.c
+++ b/drivers/acpi/pci_root.c
@@ -303,7 +303,8 @@ struct pci_dev *acpi_get_pci_dev(acpi_handle handle)
 		 * case pdev->subordinate will be NULL for the parent.
 		 */
 		if (!pbus) {
-			dev_dbg(&pdev->dev, "Not a PCI-to-PCI bridge\n");
+			dev_dbg(&root->device->dev,
+				"dev %d, function %d is not a PCI-to-PCI bridge\n", dev, fn);
 			pdev = NULL;
 			break;
 		}
-- 
2.36.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ