Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-98662 Overview
CVE-2026-98662 is a use-after-free vulnerability in the Linux kernel's Industrial I/O (IIO) subsystem, specifically in the gp2ap020a00f ambient light and proximity sensor driver. The threaded interrupt handler queues data->work through irq_work_queue() to poll the trigger from a per-CPU context. When the driver is removed, free_irq() does not flush pending irq_work already queued by the handler. After gp2ap020a00f_remove() returns, that work may still execute and invoke iio_trigger_poll() on data->trig, which the devm cleanup has already freed. The flaw was discovered through in-house static analysis and confirmed by manual review.
Critical Impact
A use-after-free in the IIO light sensor driver can lead to kernel memory corruption, local denial of service, or potential privilege escalation during driver unload or probe failure.
Affected Products
- Linux kernel versions containing the gp2ap020a00f IIO light sensor driver
- Systems using the Sharp GP2AP020A00F ambient light and proximity sensor
- Distributions shipping the vulnerable drivers/iio/light/gp2ap020a00f.c module
Discovery Timeline
- 2026-10-18 - CVE-2026-98662 published to NVD
- 2026-10-21 - Last updated in NVD database
Technical Details for CVE-2026-98662
Vulnerability Analysis
The gp2ap020a00f driver uses a threaded IRQ handler that defers trigger polling to a per-CPU context via irq_work_queue(). This design keeps the hot path short but introduces a lifetime management problem during teardown. The kernel's free_irq() function guarantees that no new IRQ handler invocations occur after it returns, but it does not flush or cancel irq_work items already queued by prior handler executions.
When gp2ap020a00f_remove() is called, the driver releases the IRQ and allows devres (devm) to free associated resources, including data->trig. If an irq_work item is still pending at that moment, it runs after the trigger has been freed and dereferences the stale pointer by calling iio_trigger_poll(data->trig). This classifies as a use-after-free [CWE-416].
The fix mirrors commit 78601726d4a5 ("iio: trigger: sysfs: fix use-after-free on remove") by adding irq_work_sync(&data->work) immediately after free_irq() in both the remove() path and the probe error path.
Root Cause
The root cause is a missing synchronization barrier between IRQ teardown and deferred work completion. The driver assumes that free_irq() is sufficient to quiesce all handler-originated activity, but queued irq_work items survive IRQ release and run asynchronously against devres-managed cleanup.
Attack Vector
Triggering requires driver unload or a probe failure while an IRQ is in flight. The race window is narrow and depends on timing between interrupt delivery, work queuing, and the remove path. Exploitation generally requires local access to physical hardware exposing the sensor or the ability to influence module loading and unloading.
See the upstream fixes for technical details: Kernel Git Commit 63213927, Kernel Git Commit 85c20d1c, Kernel Git Commit a1769877, Kernel Git Commit a36814b9, and Kernel Git Commit cc71400b.
Detection Methods for CVE-2026-98662
Indicators of Compromise
- KASAN use-after-free splats referencing iio_trigger_poll or gp2ap020a00f symbols in the kernel log
- Kernel oops or panic entries emitted during module unload (rmmod gp2ap020a00f) or probe failure
- Slab allocator warnings tied to freed IIO trigger objects accessed from irq_work context
Detection Strategies
- Audit kernel source trees for gp2ap020a00f.c lacking irq_work_sync(&data->work) after free_irq() in the remove and probe error paths
- Enable KASAN and LOCKDEP in test kernels to surface the use-after-free during stress-driven bind/unbind cycles
- Compare installed kernel versions against the fixed stable branches referenced in the upstream commits
Monitoring Recommendations
- Forward dmesg and /var/log/kern.log to a centralized logging platform and alert on KASAN, BUG:, or use-after-free strings
- Track module load and unload events through auditd (auditctl -w /sbin/rmmod -p x) for systems using IIO sensors
- Monitor for unexpected kernel crashes on devices embedding the Sharp GP2AP020A00F sensor
How to Mitigate CVE-2026-98662
Immediate Actions Required
- Apply the upstream kernel patches referenced in the stable git commits as soon as vendor builds become available
- Rebuild and redeploy custom kernels that include the gp2ap020a00f driver with the irq_work_sync() fix applied
- Avoid unnecessary bind/unbind cycles of the gp2ap020a00f driver on production systems until patched
Patch Information
The fix adds irq_work_sync(&data->work) after free_irq() in both gp2ap020a00f_remove() and the probe error path. The change has been applied across multiple stable branches via commits 63213927, 85c20d1c, a1769877, a36814b9, and cc71400b. Consult your Linux distribution's security advisories for backported package versions.
Workarounds
- Blacklist the gp2ap020a00f module on systems that do not require the sensor by adding blacklist gp2ap020a00f to /etc/modprobe.d/
- Prevent module auto-unload on affected systems where the sensor is in active use to avoid triggering the remove-path race
- Restrict unprivileged access to module management utilities to reduce the local attack surface
# Configuration example: disable the vulnerable driver until patched
echo 'blacklist gp2ap020a00f' | sudo tee /etc/modprobe.d/cve-2026-98662.conf
sudo update-initramfs -u
# Verify the module is not loaded
lsmod | grep gp2ap020a00f
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

