CVE-2026-63930: iio: buffer: hw-consumer: fix use-after-free in error path
From: Greg Kroah-Hartman <[email protected]>
Description
===========
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().
The Linux kernel CVE team has assigned CVE-2026-63930 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 5.10.259 with commit b71893c57730809c222766e5718bb33610f11963 Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 5.15.210 with commit 2ff615fc455acda5425c4900160cbe11cfea4449 Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 6.1.176 with commit d2759d49860b9a39b5cde2fb88e4b822ddf5f58f Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 6.6.143 with commit 29783e6b6ec0b7152a15e53a063f17537e81177d Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 6.12.93 with commit e965627f0d442bfcae3f496c90cb653fb0917a61 Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 6.18.35 with commit a3763ae33476328cf8d661742deb9daec78eac96 Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 7.0.12 with commit 9319c94f63ed10723afd738d79f5617daba87cc8 Issue introduced in 4.16 with commit 48b66f8f936f369bb1a43c12aedbfeb2975baf4c and fixed in 7.1 with commit 6f5ed4f2c7c83f33344e0ba179f72a12e5dad4a4
Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.
Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at
https://cve.org/CVERecord/?id=CVE-2026-63930
will be updated if fixes are backported, please check that for the most up to date information about this issue.
Affected files
==============
The file(s) affected by this issue are:
drivers/iio/buffer/industrialio-hw-consumer.c
Mitigation
==========
The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:
https://git.kernel.org/stable/c/b71893c57730809c222766e5718bb33610f11963 https://git.kernel.org/stable/c/2ff615fc455acda5425c4900160cbe11cfea4449 https://git.kernel.org/stable/c/d2759d49860b9a39b5cde2fb88e4b822ddf5f58f https://git.kernel.org/stable/c/29783e6b6ec0b7152a15e53a063f17537e81177d https://git.kernel.org/stable/c/e965627f0d442bfcae3f496c90cb653fb0917a61 https://git.kernel.org/stable/c/a3763ae33476328cf8d661742deb9daec78eac96 https://git.kernel.org/stable/c/9319c94f63ed10723afd738d79f5617daba87cc8 https://git.kernel.org/stable/c/6f5ed4f2c7c83f33344e0ba179f72a12e5dad4a4