power: supply: lp8788-charger: fix use-after-free on remove
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 98a2766493589c18c327ae3dad5243b53fcb5f70 · < 831c29a12d560f8a3225f43050b3fbb5dfd79c66| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
power: supply: lp8788-charger: fix use-after-free on remove
lp8788_charger_remove() flushes charger_work before unregistering the IRQs. An IRQ thread can queue charger_work after flush_work() has returned. The work can then run after devres frees pchg and dereference it in lp8788_charger_event().
Unregister the IRQs first. free_irq() waits for any running threaded handler, so no handler can queue more work afterwards. Then use cancel_work_sync() to cancel pending work or wait for running work to finish.
This issue was found by an in-house static analysis tool.
From the CVE record · Linux
The Linux kernel's lp8788 charger driver can use freed memory during device removal. If an IRQ thread queues charger work after the removal routine flushes it, that work can run after its data is freed. The input does not describe an attacker, access requirements, or user interaction.
Engineers running the Linux kernel with the lp8788 charger driver should check their kernel version; affected versions are not specified.