iio: adc: spear: Initialize completion before requesting IRQ
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ b586e5d9eee038b8ee6f846cdb6cf2fcbcb2f4ed · < bbfebae473ac2c8a194523b29ccb9b45f02f134c| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: adc: spear: Initialize completion before requesting IRQ
In the report from Jaeyoung Chung:
"spear_adc_probe() in drivers/iio/adc/spear_adc.c registers its interrupt handler with devm_request_irq() before it initializes st->completion with init_completion(). If an interrupt arrives after devm_request_irq() and before init_completion(), the handler calls complete() on an uninitialized completion, causing a kernel panic.
The probe path, in spear_adc_probe():
iodev = devm_iio_device_alloc(&pdev->dev, sizeof(*st)); /* st kzalloc-zeroed */ ... retval = devm_request_irq(&pdev->dev, irq, spear_adc_isr, 0, LPC32XXAD_NAME, st); /* register handler */ ... init_completion(&st->completion); /* initialize completion */
spear_adc_isr() calls complete():
complete(&st->completion);
From the CVE record · Linux
The Linux kernel spear ADC driver registers its interrupt handler before initializing a completion. If the device raises an interrupt in that interval, the handler can dereference an uninitialized pointer and cause a kernel panic. The input does not specify attacker access or user interaction requirements.
Engineers running Linux kernels with the spear ADC driver should check their installations; affected versions are not specified.