iio: adc: lpc32xx: Initialize completion before requesting IRQ
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 7901b2a1453e48c9defff2c97c67d3089bf4df7a · < 9e2e8b8cdfd37ae7c7a8a5c96c59e98a768731c4| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: adc: lpc32xx: Initialize completion before requesting IRQ
In the report from Jaeyoung Chung:
"lpc32xx_adc_probe() in drivers/iio/adc/lpc32xx_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 lpc32xx_adc_probe():
iodev = devm_iio_device_alloc(&pdev->dev, sizeof(*st)); /* st kzalloc-zeroed */ ... retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0, LPC32XXAD_NAME, st); /* register handler */ ... init_completion(&st->completion); /* initialize completion */
lpc32xx_adc_isr() calls complete():
complete(&st->completion);
From the CVE record · Linux
The Linux kernel’s lpc32xx ADC driver registers an interrupt handler before initializing a completion. If an interrupt arrives during that window in device probing, the handler can dereference an uninitialized pointer and cause a kernel panic; the input does not establish whether an attacker can trigger it.
Engineers running Linux kernels with the lpc32xx ADC driver should check their kernel; affected versions were not specified.