Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:10 +0200
commit7ea2d4eecf2962f6fd08cb7fd1ecaa17a0d7fa27 (patch)
treebbff99cde3d75194bcfa3f3cf1a8924b109dbae3
parent09276a1a3478ad6e097633781bb00de1404b26d1 (diff)
ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id()
-rw-r--r--patches.kernel.org/5.2.9-102-ACPI-IORT-Fix-off-by-one-check-in-iort_dev_find.patch51
-rw-r--r--series.conf1
2 files changed, 52 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-102-ACPI-IORT-Fix-off-by-one-check-in-iort_dev_find.patch b/patches.kernel.org/5.2.9-102-ACPI-IORT-Fix-off-by-one-check-in-iort_dev_find.patch
new file mode 100644
index 0000000000..4c061f8128
--- /dev/null
+++ b/patches.kernel.org/5.2.9-102-ACPI-IORT-Fix-off-by-one-check-in-iort_dev_find.patch
@@ -0,0 +1,51 @@
+From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Date: Mon, 22 Jul 2019 17:25:48 +0100
+Subject: [PATCH] ACPI/IORT: Fix off-by-one check in iort_dev_find_its_id()
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: 5a46d3f71d5e5a9f82eabc682f996f1281705ac7
+
+[ Upstream commit 5a46d3f71d5e5a9f82eabc682f996f1281705ac7 ]
+
+Static analysis identified that index comparison against ITS entries in
+iort_dev_find_its_id() is off by one.
+
+Update the comparison condition and clarify the resulting error
+message.
+
+Fixes: 4bf2efd26d76 ("ACPI: Add new IORT functions to support MSI domain handling")
+Link: https://lore.kernel.org/linux-arm-kernel/20190613065410.GB16334@mwanda/
+Reviewed-by: Hanjun Guo <guohanjun@huawei.com>
+Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
+Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
+Cc: Dan Carpenter <dan.carpenter@oracle.com>
+Cc: Will Deacon <will@kernel.org>
+Cc: Hanjun Guo <guohanjun@huawei.com>
+Cc: Sudeep Holla <sudeep.holla@arm.com>
+Cc: Catalin Marinas <catalin.marinas@arm.com>
+Cc: Robin Murphy <robin.murphy@arm.com>
+Signed-off-by: Will Deacon <will@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ drivers/acpi/arm64/iort.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c
+index d4551e33fa71..8569b79e8b58 100644
+--- a/drivers/acpi/arm64/iort.c
++++ b/drivers/acpi/arm64/iort.c
+@@ -611,8 +611,8 @@ static int iort_dev_find_its_id(struct device *dev, u32 req_id,
+
+ /* Move to ITS specific data */
+ its = (struct acpi_iort_its_group *)node->node_data;
+- if (idx > its->its_count) {
+- dev_err(dev, "requested ITS ID index [%d] is greater than available [%d]\n",
++ if (idx >= its->its_count) {
++ dev_err(dev, "requested ITS ID index [%d] overruns ITS entries [%d]\n",
+ idx, its->its_count);
+ return -ENXIO;
+ }
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 4e4e4f8024..5bcd81c92c 100644
--- a/series.conf
+++ b/series.conf
@@ -1122,6 +1122,7 @@
patches.kernel.org/5.2.9-099-perf-session-Fix-loading-of-compressed-data-spl.patch
patches.kernel.org/5.2.9-100-perf-probe-Avoid-calling-freeing-routine-multip.patch
patches.kernel.org/5.2.9-101-drbd-dynamically-allocate-shash-descriptor.patch
+ patches.kernel.org/5.2.9-102-ACPI-IORT-Fix-off-by-one-check-in-iort_dev_find.patch
########################################################
# Build fixes that apply to the vanilla kernel too.