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:	Wed, 14 Jul 2010 10:02:03 -0700
From:	Ben Greear <greearb@...delatech.com>
To:	linux-kernel@...r.kernel.org
Cc:	Ben Greear <greearb@...delatech.com>
Subject: [pci] pci/mrst:  Detect loops when reading fixed BAR cap.

The mrst logic introduced in 2.6.33-rc8 in commit
a712ffbc199849364c46e9112b93b66de08e2c26 causes boot
to hang on at least this platform:

Intel E5405 CPU
System Information
	Manufacturer: Supermicro
	Product Name: X7DBU

The cause of the hang is that pci_cap points to itself
as the next capability, putting the fixed_bar_cap into
an endless loop.

This patch detects the loop, prints a warning, and
continues on with useful work.  This strategy was
suggested by Robert Hancock <hancockrwd@...il.com>

This should be a candidate for 2.6.34.y as well.

Signed-off-by: Ben Greear <greearb@...delatech.com>
---
:100644 100644 1cdc02c... 9535ba9... M	arch/x86/pci/mrst.c
 arch/x86/pci/mrst.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/arch/x86/pci/mrst.c b/arch/x86/pci/mrst.c
index 1cdc02c..9535ba9 100644
--- a/arch/x86/pci/mrst.c
+++ b/arch/x86/pci/mrst.c
@@ -76,6 +76,17 @@ static int fixed_bar_cap(struct pci_bus *bus, unsigned int devfn)
 				return pos;
 		}
 
+		if ((pcie_cap >> 20) == 0)
+			break;
+		
+		if ((pcie_cap >> 20) <= pos) {
+			printk(KERN_WARNING "WARNING: mrst:  detected loop"
+			       " when searching for fixed BAR cap, previous"
+			       " position: 0x%x new position: 0x%x"
+			       " bus-number: %i  devfn: %i\n",
+			       pos, pcie_cap >> 20, bus->number, devfn);
+			break;
+		}
 		pos = pcie_cap >> 20;
 	}
 
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ