power: supply: lp8727: fix use-after-free in lp8727_release_irq()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ d71fda01610269e3aaedd451f8d3e34cdf550036 · < ab6b1ad710bed7931540733ce145493fece8ceef| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
power: supply: lp8727: fix use-after-free in lp8727_release_irq()
lp8727_isr_func(), the threaded IRQ handler, is the only caller that arms pchg->work via schedule_delayed_work(). lp8727_release_irq() currently cancels the work before freeing the IRQ, so an IRQ delivered in between can re-arm the work through the threaded handler. After .remove returns the devm layer frees pchg while lp8727_delayed_func() may still run and dereference it.
Free the IRQ first so the threaded handler is quiesced and can no longer queue work, then cancel the delayed work to drain the final generation.
This issue was found by an in-house static analysis tool.
From the CVE record · Linux
The Linux kernel's lp8727 driver can leave delayed work running after device removal if an IRQ arrives between work cancellation and IRQ release. That work may dereference freed memory. The input does not establish whether an attacker can trigger this condition or specify access or interaction requirements.
Engineers running Linux kernels with the lp8727 power supply driver should check their versions; affected versions are not specified.