of/overlay: only treat a positive changeset id as registered
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 61b4de4e0b384f4a22c55c3bada604da49cec4e1 · < c875407c34dadaef0599834ad9c815f4c9f50d15| No fix yet |
| Linux Linux |
|
|
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.
From the CVE record · Linux
The Linux kernel’s OF overlay code can dereference NULL if ID allocation fails while applying an overlay. The description does not specify how an attacker could trigger the failure or whether authentication, network access, or user interaction is required.
Engineers running the Linux kernel should check their vendor’s advisory for affected versions.