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]
Message-ID: <20200225090136.40989-1-guoheyi@huawei.com>
Date:   Tue, 25 Feb 2020 17:01:36 +0800
From:   Heyi Guo <guoheyi@...wei.com>
To:     <devel@...2.groups.io>
CC:     <wanghaibin.wang@...wei.com>, Heyi Guo <guoheyi@...wei.com>,
        "Lorenzo Pieralisi" <lorenzo.pieralisi@....com>,
        Hanjun Guo <guohanjun@...wei.com>,
        Sudeep Holla <sudeep.holla@....com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Len Brown <lenb@...nel.org>, <linux-acpi@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] acpi/iort: check output reference for the real used mapping

The function iort_node_map_id() does the sanity check against the
first mapping in the node, but not the one which we really use.

Logically we need check the mapping we use, or check every mapping in
the node. Choose the first fix for we are not firmware tester.

Signed-off-by: Heyi Guo <guoheyi@...wei.com>

---
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
Cc: Hanjun Guo <guohanjun@...wei.com>
Cc: Sudeep Holla <sudeep.holla@....com>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Len Brown <lenb@...nel.org>
Cc: linux-acpi@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org
---
 drivers/acpi/arm64/iort.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
index ed3d2d1a7ae9..d0fe8d673240 100644
--- a/drivers/acpi/arm64/iort.c
+++ b/drivers/acpi/arm64/iort.c
@@ -470,13 +470,6 @@ static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node,
 		map = ACPI_ADD_PTR(struct acpi_iort_id_mapping, node,
 				   node->mapping_offset);
 
-		/* Firmware bug! */
-		if (!map->output_reference) {
-			pr_err(FW_BUG "[node %p type %d] ID map has NULL parent reference\n",
-			       node, node->type);
-			goto fail_map;
-		}
-
 		/*
 		 * Get the special ID mapping index (if any) and skip its
 		 * associated ID map to prevent erroneous multi-stage
@@ -497,6 +490,13 @@ static struct acpi_iort_node *iort_node_map_id(struct acpi_iort_node *node,
 		if (i == node->mapping_count)
 			goto fail_map;
 
+		/* Firmware bug! */
+		if (!map->output_reference) {
+			pr_err(FW_BUG "[node %p type %d] ID map has NULL parent reference\n",
+			       node, node->type);
+			goto fail_map;
+		}
+
 		node = ACPI_ADD_PTR(struct acpi_iort_node, iort_table,
 				    map->output_reference);
 	}
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ