]> git.baikalelectronics.ru Git - kernel.git/commit
irqchip/loongarch: Fix irq_domain_alloc_fwnode() abuse
authorMarc Zyngier <maz@kernel.org>
Mon, 8 Aug 2022 10:50:20 +0000 (11:50 +0100)
committerMarc Zyngier <maz@kernel.org>
Tue, 9 Aug 2022 05:54:05 +0000 (06:54 +0100)
commitab0686c60c2da52c71e1335b7646223b958fe158
treec3a1b02d13d3ee1a6de2eadb15d19501413a7882
parentcfc8c3d8c2340b24170b1528d90ad84a2dd6f96d
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
drivers/irqchip/irq-loongarch-cpu.c
drivers/irqchip/irq-loongson-eiointc.c
drivers/irqchip/irq-loongson-liointc.c
drivers/irqchip/irq-loongson-pch-msi.c
drivers/irqchip/irq-loongson-pch-pic.c