CVE-2026-98854: of/overlay: only treat a positive changeset id as registered
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
of/overlay: only treat a positive changeset id as registered
of_overlay_fdt_apply() stores the idr_alloc() return value in ovcs->id before checking it. On failure the stored id is negative, free_overlay_changeset()'s "if (ovcs->id)" check passes, idr_remove() is called with a negative id and list_del() runs on ovcs->ovcs_list, which is not initialized until after the id allocation. An allocation failure at that point dereferences NULL.
Make free_overlay_changeset() treat only a strict-positive id as registered. The rest of the function already copes with a partially-initialized ovcs, so the error path stays a plain goto err_free_ovcs.
The Linux kernel CVE team has assigned CVE-2026-98854 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.15 with commit 61b4de4e0b384f4a22c55c3bada604da49cec4e1 and fixed in 6.12.113 with commit c08a54df9d33dcd6ff089adc9434b2c008af3a39 Issue introduced in 4.15 with commit 61b4de4e0b384f4a22c55c3bada604da49cec4e1 and fixed in 6.18.56 with commit 0d1525fdcd3355672b7485d61e55df6824ab5ad1 Issue introduced in 4.15 with commit 61b4de4e0b384f4a22c55c3bada604da49cec4e1 and fixed in 7.2.10 with commit c875407c34dadaef0599834ad9c815f4c9f50d15 Issue introduced in 4.15 with commit 61b4de4e0b384f4a22c55c3bada604da49cec4e1 and fixed in 7.3-rc6 with commit 44081d708b5b885487bac792db78324b7b4c267d
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-98854
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/of/overlay.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/c08a54df9d33dcd6ff089adc9434b2c008af3a39 https://git.kernel.org/stable/c/0d1525fdcd3355672b7485d61e55df6824ab5ad1 https://git.kernel.org/stable/c/c875407c34dadaef0599834ad9c815f4c9f50d15 https://git.kernel.org/stable/c/44081d708b5b885487bac792db78324b7b4c267d