diff options
author | Marc Zyngier <maz@kernel.org> | 2022-08-08 12:50:20 +0200 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-08-09 07:54:05 +0200 |
commit | 7e4fd7a1a6fdf23d069eeb0ae0e8e46b9fb40723 (patch) | |
tree | c3a1b02d13d3ee1a6de2eadb15d19501413a7882 /drivers/irqchip/irq-loongson-pch-msi.c | |
parent | irqchip/loongson-pch-pic: Move find_pch_pic() into CONFIG_ACPI (diff) | |
download | linux-7e4fd7a1a6fdf23d069eeb0ae0e8e46b9fb40723.tar.xz linux-7e4fd7a1a6fdf23d069eeb0ae0e8e46b9fb40723.zip |
irqchip/loongarch: Fix irq_domain_alloc_fwnode() abuse
The recently merged LoongArch drivers paper over the lack of
topology information by creating a bunch of fwnodes for the
irqchips. So far, so good.
However, irq_domain_alloc_fwnode() is supposed to take a PA, and
not a kernel VA blindly cast as a PA, potentially disclosing
kernel VAs to userspace. In some other cases, even NULL is used
as the PA, which is entertaining.
Fix this by using the actual PA of the block when available,
and switch to a named fwnode in the other cases.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Jianmin Lv <lvjianmin@loongson.cn>
Link: https://lore.kernel.org/r/20220808105020.2689757-1-maz@kernel.org
Diffstat (limited to 'drivers/irqchip/irq-loongson-pch-msi.c')
-rw-r--r-- | drivers/irqchip/irq-loongson-pch-msi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-loongson-pch-msi.c b/drivers/irqchip/irq-loongson-pch-msi.c index d0e8551bebfa..a72ede90ffc6 100644 --- a/drivers/irqchip/irq-loongson-pch-msi.c +++ b/drivers/irqchip/irq-loongson-pch-msi.c @@ -282,7 +282,7 @@ int __init pch_msi_acpi_init(struct irq_domain *parent, int ret; struct fwnode_handle *domain_handle; - domain_handle = irq_domain_alloc_fwnode((phys_addr_t *)acpi_pchmsi); + domain_handle = irq_domain_alloc_fwnode(&acpi_pchmsi->msg_address); ret = pch_msi_init(acpi_pchmsi->msg_address, acpi_pchmsi->start, acpi_pchmsi->count, parent, domain_handle); if (ret < 0) |