In the Linux kernel, the following vulnerability has been resolved: mfd: tps65217: Use devres for IRQ domain and wake teardown Removing the parent device used to tear the IRQ domain down in tps65217_remove() before the MFD children are unbound: the i2c core only releases the parent's devres after the remove callback returns, whereas devm_mfd_add_devices() registered its own devres action which unbinds the children. Children that requested interrupts from the domain (e.g. tps65217-charger) therefore call free_irq() on virtual IRQs whose descriptors have already been disposed. With CONFIG_SPARSE_IRQ free_irq() then returns early without stopping the threaded handler, leaking the irqaction, the IRQ kthread and a module reference. Register the domain teardown as a devres action right after the domain is created instead. Devres actions are released in reverse order of registration, so the MFD children release their IRQs first, then the parent interrupt is freed and its thread stopped, and only then is the domain torn down. The same ordering covers probe failure, which no longer needs manual cleanup, and the remove callback can be dropped entirely. Balance the enable_irq_wake() in tps65217_irq_init() by registering disable_irq_wake() as a devres action as well. Only do so when enabling actually succeeded, since the parent chip may not support setting wake-up.
https://git.kernel.org/stable/c/cffd44d2d89524e2dda6adc7b0dd59363be1c8e6
https://git.kernel.org/stable/c/cf662773b6bc3dd0c2807630d153e0b9332fa21e
https://git.kernel.org/stable/c/c879c50d4019af0cde5baa2355a20cb96477de20
https://git.kernel.org/stable/c/bbf6326db27f400d59c673b61bcdfec0789af437
https://git.kernel.org/stable/c/9be904fdb42eec5cde37587958f585e76be6f487
https://git.kernel.org/stable/c/42e39e25b62e2d0b63e8cf0426b720b486353ecc
https://git.kernel.org/stable/c/3085eccfdab176c4b4957b5cb78e61d30580ded2
https://git.kernel.org/stable/c/0159dd82ca05a23f5512632f569635fc51c50897