Re: [PATCH] irqdomain/treewide: Free firmware node after domain removal

From: Thomas Gleixner
Date: Wed Jul 22 2020 - 17:15:12 EST


Jon Derrick <jonathan.derrick@xxxxxxxxx> writes:
> Change 711419e504eb ("irqdomain: Add the missing assignment of
> domain->fwnode for named fwnode") unintentionally caused a dangling
> pointer page fault issue on firmware nodes that were freed after IRQ
> domain allocation. Change e3beca48a45b fixed that dangling pointer issue
> by only freeing the firmware node after an IRQ domain allocation
> failure. That fix no longer frees the firmware node immediately, but
> leaves the firmware node allocated after the domain is removed.

Gah, I missed that under the assumption that these nodes are freed when
the domain is removed. What a mess.

> We need to keep the firmware node through irq_domain_remove, but should
> free it afterwards. This patch saves the handle and adds the freeing of
> firmware node after domain removal where appropriate.

Care to read Documentation/process/submitting-patches.rst and look for
'I/We' and 'This patch' next time?

Thanks,

tglx