iio: buffer: hw-consumer: fix use-after-free in error path
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 48b66f8f936f369bb1a43c12aedbfeb2975baf4c · < a3763ae33476328cf8d661742deb9daec78eac96| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
iio: buffer: hw-consumer: fix use-after-free in error path
In the err_put_buffers cleanup path of iio_hw_consumer_alloc(), the code was using list_for_each_entry() to iterate through buffers while calling iio_buffer_put() which can free the current buffer if refcount drops to 0. The list_for_each_entry() loop macro then evaluates buf->head.next to continue iteration, accessing the freed buffer.
Fix this by using list_for_each_entry_safe().
From the CVE record · Linux
The Linux kernel's IIO hardware consumer buffer allocation has a use-after-free in its error cleanup path. If releasing a buffer frees it, the cleanup loop can access that freed buffer. The input does not specify how an attacker could trigger this path or whether access or user interaction is required.
Engineers running Linux kernels with the affected IIO hardware consumer buffer code should check their kernel versions; affected versions were not provided.