of: Fix double free in of_parse_phandle_with_args_map
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ bd6f2fd5a1d52198468c5cdc3c2472362dff5aaa · < b64d09a4e8596f76d27f4b4a90a1cf6baf6a82f8| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
of: Fix double free in of_parse_phandle_with_args_map
In of_parse_phandle_with_args_map() the inner loop that iterates through the map entries calls of_node_put(new) to free the reference acquired by the previous iteration of the inner loop. This assumes that the value of "new" is NULL on the first iteration of the inner loop.
Make sure that this is true in all iterations of the outer loop by setting "new" to NULL after its value is assigned to "cur".
Extend the unittest to detect the double free and add an additional test case that actually triggers this path.
From the CVE record · Linux
A double free can occur in the Linux kernel’s of_parse_phandle_with_args_map() when its inner loop runs after a previous outer-loop iteration. The input does not establish what an attacker could do, whether access is local or network-based, or whether authentication or user interaction is required.
Engineers running the Linux kernel should check their deployments; affected versions are not specified.