HIGH Introduced in 5.19
iio AdSigmaDelta UAF
CVE-2026-98677
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
01Description
In the Linux kernel, the following vulnerability has been resolved: iio: adc: ad_sigma_delta: fix use-after-free on unbind ad_sd_buffer_postenable() allocates sigma_delta->samples_buf with devm_krealloc() at runtime, so its devres entry sits after all probe-time entries of the driver. devm resources are released in reverse allocation order, which means unbind frees samples_buf before iio_device_unregister() disables the buffers and detaches the trigger pollfunc. The data ready IRQ is still enabled at that point, so ad_sd_trigger_handler() can still run and memcpy() incoming samples into the freed samples_buf. Fix this by preallocating the buffer in devm_ad_sd_setup_buffer_and_trigger(), before the triggered buffer and the IRQ are set up, so it is freed only after iio_device_unregister() has drained the trigger handler via free_irq(). Size it for the worst case of all sequencer slots being active; ad_sd_validate_scan_mask() already caps the number of active channels at num_slots. This issue was found by an in-house static analysis tool.
02KernelScan AI Analysis
Risk summary
A use-after-free in the AD sigma-delta ADC driver allows a local attacker with root privileges to corrupt kernel memory by unbinding the driver while the data-ready IRQ is still active. The freed sample buffer can be written to by the trigger handler, leading to privilege escalation or kernel panic. Physical device removal (hotplug) can also trigger the flaw.
Vulnerability analysis
The driver allocates a sample buffer at runtime when the IIO buffer is enabled, but this allocation occurs after probe-time device resources. During driver unbind, the devres subsystem releases resources in reverse allocation order, so the sample buffer is freed before iio_device_unregister() disables the buffer and detaches the trigger. The data-ready IRQ remains enabled at that point, allowing the trigger handler to memcpy incoming samples into the already-freed buffer. The fix preallocates the buffer at probe time in devm_ad_sd_setup_buffer_and_trigger(), before the triggered buffer and IRQ are set up, ensuring the buffer persists until after the IRQ is freed. An attacker needs root privileges (CAP_SYS_ADMIN in the init namespace) to bind/unbind the driver or remove the module, or physical access to hot-unplug the ADC device.
Lifecycle
03Fix Versions
| Branch | Introduced | Fixed in | Patch commit |
|---|---|---|---|
| 6.1 | 5.19 | 6.1.191 | b2a991d33f1e |
| 6.12 | 5.19 | 6.12.113 | 84500ae0d976 |
| 6.18 | 5.19 | 6.18.56 | f20b94a7dc1f |
| 6.6 | 5.19 | 6.6.160 | 975b09bc680a |
| 7.2 | 5.19 | 7.2.10 | 5663c72bf400 |
| mainline | 5.19 | 7.3 | 9ee830612149 |
| cip/6.12 | 5.19 | 6.12.114-cip34 | 84500ae0d976 |
04CIP Kernels
State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.
| CIP tree | State |
|---|---|
| cip/6.12 | Fixed in 6.12.114-cip34 |
| cip/6.1 | Affected — no CIP fix yet (latest 6.1.190-cip62) |
| cip/6.1-rt | Affected — no CIP fix yet (latest 6.1.189-cip61-rt32) |