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:	Mon, 8 Feb 2016 16:30:23 -0600
From:	Stuart Yoder <stuart.yoder@....com>
To:	<robh@...nel.org>, <frowand.list@...il.com>,
	<grant.likely@...aro.org>, <devicetree@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>
CC:	<marc.zyngier@....com>, <david.daney@...ium.com>,
	<mark.rutland@....com>, Stuart Yoder <stuart.yoder@....com>
Subject: [PATCH] of/irq: fix bug in computing output requester-id for an msi-map

From: Stuart Yoder <stuart.yoder@....com>

The binding for msi-map specifies that the output requester id
should be computed as: (r - rid-base + msi-base)

...update the code accordingly.

Signed-off-by: Stuart Yoder <stuart.yoder@....com>
---
 drivers/of/irq.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 706e3ff..3f5e5fd 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -589,6 +589,7 @@ static u32 __of_msi_map_rid(struct device *dev, struct device_node **np,
 	struct device_node *msi_controller_node;
 	struct device_node *msi_np = *np;
 	u32 map_mask, masked_rid, rid_base, msi_base, rid_len, phandle;
+	u32 masked_rid_base;
 	int msi_map_len;
 	bool matched;
 	u32 rid_out = rid_in;
@@ -654,7 +655,8 @@ static u32 __of_msi_map_rid(struct device *dev, struct device_node **np,
 	if (!matched)
 		return rid_out;
 
-	rid_out = masked_rid + msi_base;
+	masked_rid_base = map_mask & rid_base;
+	rid_out = msi_base + (masked_rid - masked_rid_base);
 	dev_dbg(dev,
 		"msi-map at: %s, using mask %08x, rid-base: %08x, msi-base: %08x, length: %08x, rid: %08x -> %08x\n",
 		dev_name(parent_dev), map_mask, rid_base, msi_base,
-- 
1.7.9.5

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ