Skip to contentSkip to conversation

ACPI/IORT: Use the correct ITS node in iort_pmsi_get_msi_info()

PATCH Superseded Zenghui Yu 2 participants 3 messages Nov 30 – Dec 1

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Zenghui Yu

author
#0 lore raw

PATCH 1/1 ACPI/IORT: Use the correct ITS node in iort_pmsi_get_msi_info()

The helper reads the ITS identifier from @node->node_data (the device's own IORT node) instead of the ITS node. The value contains random bits, so platform MSI setup can fail or program a wrong translate frame.

Use @parent->node_data, as iort_msi_xlate() already does.

Fixes a97efa5ba594 ("irqchip/gic-v5: Add ACPI ITS probing")
---
 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/arm64/iort.c +1 -1
index 1020ac953e42..a0bc420ef48e 100644
@@ -721,7 +721,7 @@ int iort_pmsi_get_msi_info(struct device *dev, u32 *dev_id, phys_addr_t *pa)
 	if (pa) {
 		int ret;
 
-		its = (struct acpi_iort_its_group *)node->node_data;
+		its = (struct acpi_iort_its_group *)parent->node_data;
 		ret = iort_find_its_base(its->identifiers[0], pa);
 		if (ret)
 			return ret;
Signature · 1 line
2.33.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Zenghui Yu

The helper reads the ITS identifier from @node->node_data (the device's own IORT node) instead of the ITS node. The value contains random bits, so platform MSI setup can fail or program a wrong translate frame.

Use @parent->node_data, as iort_msi_xlate() already does.

Fixes a97efa5ba594 ("irqchip/gic-v5: Add ACPI ITS probing")
---
 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

This must go to stable kernels, thank you for fixing it.

Can you resend it with a stable tag so that Catalin or Will can pick it up please (or Catalin/Will can add the tag on applying it - please) ?

Thanks,
Lorenzo

Quoted 16 lines
drivers/acpi/arm64/iort.c +1 -1
index 1020ac953e42..a0bc420ef48e 100644
@@ -721,7 +721,7 @@ int iort_pmsi_get_msi_info(struct device *dev, u32 *dev_id, phys_addr_t *pa)
 	if (pa) {
 		int ret;
 
-		its = (struct acpi_iort_its_group *)node->node_data;
+		its = (struct acpi_iort_its_group *)parent->node_data;
 		ret = iort_find_its_base(its->identifiers[0], pa);
 		if (ret)
 			return ret;
Signature · 1 line
2.33.0
author
#2 lore raw
Quoted 7 lines · Lorenzo Pieralisi
Quoted 6 lines · Zenghui Yu

The helper reads the ITS identifier from @node->node_data (the device's own IORT node) instead of the ITS node. The value contains random bits, so platform MSI setup can fail or program a wrong translate frame.

Use @parent->node_data, as iort_msi_xlate() already does.

Quoted 7 lines
Quoted 5 lines
Fixes a97efa5ba594 ("irqchip/gic-v5: Add ACPI ITS probing")
---
 drivers/acpi/arm64/iort.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Thanks!

Quoted 5 lines

This must go to stable kernels, thank you for fixing it.

Can you resend it with a stable tag so that Catalin or Will can pick it up please (or Catalin/Will can add the tag on applying it - please) ?

I'll resend it.

Thanks,
Zenghui