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,  4 Mar 2015 17:24:24 -0500
From:	Mark Salter <msalter@...hat.com>
To:	Tanmay Inamdar <tinamdar@....com>
Cc:	Bjorn Helgaas <bhelgaas@...gle.com>, Rob Herring <robh@...nel.org>,
	linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Mark Salter <msalter@...hat.com>
Subject: [PATCH] PCI: xgene: fix breakage from generic config usage

Commit 350f8be5bb402 ("PCI: xgene: Convert to use generic config
accessors") breaks PCI on the X-Gene platform. It creates two
problems with the xgene_pcie_map_bus() function. First, it returns
an int but should return a void __iomem *, but that's just a
compile-time warning. The breakage is caused by the offset not
being added to the base of the config map. So all config reads
and writes operate on the first four bytes of config space. This
patch fixes both issues.

Signed-off-by: Mark Salter <msalter@...hat.com>
---
 drivers/pci/host/pci-xgene.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/host/pci-xgene.c b/drivers/pci/host/pci-xgene.c
index 52bb25c..b87f80b 100644
--- a/drivers/pci/host/pci-xgene.c
+++ b/drivers/pci/host/pci-xgene.c
@@ -129,17 +129,21 @@ static bool xgene_pcie_hide_rc_bars(struct pci_bus *bus, int offset)
 	return false;
 }
 
-static int xgene_pcie_map_bus(struct pci_bus *bus, unsigned int devfn,
-			      int offset)
+static void __iomem *xgene_pcie_map_bus(struct pci_bus *bus, unsigned int devfn,
+					int offset)
 {
 	struct xgene_pcie_port *port = bus->sysdata;
+	void __iomem *base;
 
 	if ((pci_is_root_bus(bus) && devfn != 0) || !port->link_up ||
 	    xgene_pcie_hide_rc_bars(bus, offset))
 		return NULL;
 
 	xgene_pcie_set_rtdid_reg(bus, devfn);
-	return xgene_pcie_get_cfg_base(bus);
+	base = xgene_pcie_get_cfg_base(bus);
+	if (base)
+		base += offset;
+	return base;
 }
 
 static struct pci_ops xgene_pcie_ops = {
-- 
1.8.3.1

--
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