iio: light: gp2ap020a00f: drain irq_work after free_irq
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ bf29fbeaa13d3350ca71df70c705d8b883c45692 · < cc71400bc965c0d3894a38ead3d71243400c2d5e| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: light: gp2ap020a00f: drain irq_work after free_irq
The threaded IRQ handler queues data->work through irq_work_queue() so the trigger is polled from a per-CPU context. free_irq() does not flush an irq_work the handler already queued, so after gp2ap020a00f_remove() returns that work may still run and call iio_trigger_poll() on data->trig, which the devm cleanup has already freed, causing a use-after-free.
Add irq_work_sync(&data->work) after free_irq() in remove() and in the probe error path, mirroring commit 78601726d4a5 ("iio: trigger: sysfs: fix use-after-free on remove").
Found by an in-house static analysis tool, confirmed by manual review.
From the CVE record · Linux
The gp2ap020a00f light sensor driver can run queued IRQ work after device removal has freed its trigger, causing a use-after-free. The input does not specify whether an attacker can trigger this, or any network, authentication, or user-interaction conditions.
Engineers running Linux kernels with the gp2ap020a00f driver should check their versions; affected versions are not specified.